-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbundle.js.map
93 lines (93 loc) · 286 KB
/
bundle.js.map
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{
"version": 3,
"sources": [
"../../Users/cheahshen/AppData/Roaming/npm/node_modules/ksana-cli/node_modules/browserify/node_modules/browser-pack/_prelude.js",
"../node_modules/ksana2015-webruntime/downloader.js",
"../node_modules/ksana2015-webruntime/html5fs.js",
"../node_modules/ksana2015-webruntime/ksanagap.js",
"../node_modules/ksana2015-webruntime/livereload.js",
"../node_modules/ksana2015-webruntime/mkdirp.js",
"../node_modules/reflux/index.js",
"../node_modules/reflux/node_modules/eventemitter3/index.js",
"../node_modules/reflux/node_modules/native-promise-only/npo.js",
"../node_modules/reflux/src/ActionMethods.js",
"../node_modules/reflux/src/Keep.js",
"../node_modules/reflux/src/ListenerMethods.js",
"../node_modules/reflux/src/ListenerMixin.js",
"../node_modules/reflux/src/PublisherMethods.js",
"../node_modules/reflux/src/StoreMethods.js",
"../node_modules/reflux/src/bindMethods.js",
"../node_modules/reflux/src/connect.js",
"../node_modules/reflux/src/connectFilter.js",
"../node_modules/reflux/src/createAction.js",
"../node_modules/reflux/src/createStore.js",
"../node_modules/reflux/src/index.js",
"../node_modules/reflux/src/joins.js",
"../node_modules/reflux/src/listenTo.js",
"../node_modules/reflux/src/listenToMany.js",
"../node_modules/reflux/src/mixer.js",
"../node_modules/reflux/src/utils.js",
"index.js",
"node_modules/glyphemesearch/index.js",
"node_modules/kage/index.js",
"node_modules/strokecount/index.js",
"node_modules/strokecount/strokecount.js",
"node_modules/strokecount/strokestr.js",
"node_modules/whatwg-fetch/fetch.js",
"src/actions.js",
"src/candidates.js",
"src/glyphinfo.js",
"src/glyphsearch.js",
"src/kageglyph.js",
"src/main.js",
"src/store.js",
"src/usekage.js"
],
"names": [],
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrOA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/kFA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
"file": "generated.js",
"sourceRoot": "",
"sourcesContent": [
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})",
"\r\nvar userCancel=false;\r\nvar files=[];\r\nvar totalDownloadByte=0;\r\nvar targetPath=\"\";\r\nvar tempPath=\"\";\r\nvar nfile=0;\r\nvar baseurl=\"\";\r\nvar result=\"\";\r\nvar downloading=false;\r\nvar startDownload=function(dbid,_baseurl,_files) { //return download id\r\n\tvar fs = require(\"fs\");\r\n\tvar path = require(\"path\");\r\n\r\n\t\r\n\tfiles=_files.split(\"\\uffff\");\r\n\tif (downloading) return false; //only one session\r\n\tuserCancel=false;\r\n\ttotalDownloadByte=0;\r\n\tnextFile();\r\n\tdownloading=true;\r\n\tbaseurl=_baseurl;\r\n\tif (baseurl[baseurl.length-1]!='/')baseurl+='/';\r\n\ttargetPath=ksanagap.rootPath+dbid+'/';\r\n\ttempPath=ksanagap.rootPath+\".tmp/\";\r\n\tresult=\"\";\r\n\treturn true;\r\n}\r\n\r\nvar nextFile=function() {\r\n\tsetTimeout(function(){\r\n\t\tif (nfile==files.length) {\r\n\t\t\tnfile++;\r\n\t\t\tendDownload();\r\n\t\t} else {\r\n\t\t\tdownloadFile(nfile++);\t\r\n\t\t}\r\n\t},100);\r\n}\r\n\r\nvar downloadFile=function(nfile) {\r\n\tvar url=baseurl+files[nfile];\r\n\tvar tmpfilename=tempPath+files[nfile];\r\n\tvar mkdirp = require(\"./mkdirp\");\r\n\tvar fs = require(\"fs\");\r\n\tvar http = require(\"http\");\r\n\r\n\tmkdirp.sync(path.dirname(tmpfilename));\r\n\tvar writeStream = fs.createWriteStream(tmpfilename);\r\n\tvar datalength=0;\r\n\tvar request = http.get(url, function(response) {\r\n\t\tresponse.on('data',function(chunk){\r\n\t\t\twriteStream.write(chunk);\r\n\t\t\ttotalDownloadByte+=chunk.length;\r\n\t\t\tif (userCancel) {\r\n\t\t\t\twriteStream.end();\r\n\t\t\t\tsetTimeout(function(){nextFile();},100);\r\n\t\t\t}\r\n\t\t});\r\n\t\tresponse.on(\"end\",function() {\r\n\t\t\twriteStream.end();\r\n\t\t\tsetTimeout(function(){nextFile();},100);\r\n\t\t});\r\n\t});\r\n}\r\n\r\nvar cancelDownload=function() {\r\n\tuserCancel=true;\r\n\tendDownload();\r\n}\r\nvar verify=function() {\r\n\treturn true;\r\n}\r\nvar endDownload=function() {\r\n\tnfile=files.length+1;//stop\r\n\tresult=\"cancelled\";\r\n\tdownloading=false;\r\n\tif (userCancel) return;\r\n\tvar fs = require(\"fs\");\r\n\tvar mkdirp = require(\"./mkdirp\");\r\n\r\n\tfor (var i=0;i<files.length;i++) {\r\n\t\tvar targetfilename=targetPath+files[i];\r\n\t\tvar tmpfilename =tempPath+files[i];\r\n\t\tmkdirp.sync(path.dirname(targetfilename));\r\n\t\tfs.renameSync(tmpfilename,targetfilename);\r\n\t}\r\n\tif (verify()) {\r\n\t\tresult=\"success\";\r\n\t} else {\r\n\t\tresult=\"error\";\r\n\t}\r\n}\r\n\r\nvar downloadedByte=function() {\r\n\treturn totalDownloadByte;\r\n}\r\nvar doneDownload=function() {\r\n\tif (nfile>files.length) return result;\r\n\telse return \"\";\r\n}\r\nvar downloadingFile=function() {\r\n\treturn nfile-1;\r\n}\r\n\r\nvar downloader={startDownload:startDownload, downloadedByte:downloadedByte,\r\n\tdownloadingFile:downloadingFile, cancelDownload:cancelDownload,doneDownload:doneDownload};\r\nmodule.exports=downloader;",
"/* emulate filesystem on html5 browser */\r\nvar get_head=function(url,field,cb){\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(\"HEAD\", url, true);\r\n\txhr.onreadystatechange = function() {\r\n\t\t\tif (this.readyState == this.DONE) {\r\n\t\t\t\tcb(xhr.getResponseHeader(field));\r\n\t\t\t} else {\r\n\t\t\t\tif (this.status!==200&&this.status!==206) {\r\n\t\t\t\t\tcb(\"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t};\r\n\txhr.send();\r\n}\r\nvar get_date=function(url,cb) {\r\n\tget_head(url,\"Last-Modified\",function(value){\r\n\t\tcb(value);\r\n\t});\r\n}\r\nvar get_size=function(url, cb) {\r\n\tget_head(url,\"Content-Length\",function(value){\r\n\t\tcb(parseInt(value));\r\n\t});\r\n};\r\nvar checkUpdate=function(url,fn,cb) {\r\n\tif (!url) {\r\n\t\tcb(false);\r\n\t\treturn;\r\n\t}\r\n\tget_date(url,function(d){\r\n\t\tAPI.fs.root.getFile(fn, {create: false, exclusive: false}, function(fileEntry) {\r\n\t\t\tfileEntry.getMetadata(function(metadata){\r\n\t\t\t\tvar localDate=Date.parse(metadata.modificationTime);\r\n\t\t\t\tvar urlDate=Date.parse(d);\r\n\t\t\t\tcb(urlDate>localDate);\r\n\t\t\t});\r\n\t\t},function(){\r\n\t\t\tcb(false);\r\n\t\t});\r\n\t});\r\n}\r\nvar download=function(url,fn,cb,statuscb,context) {\r\n\t var totalsize=0,batches=null,written=0;\r\n\t var fileEntry=0, fileWriter=0;\r\n\t var createBatches=function(size) {\r\n\t\tvar bytes=1024*1024, out=[];\r\n\t\tvar b=Math.floor(size / bytes);\r\n\t\tvar last=size %bytes;\r\n\t\tfor (var i=0;i<=b;i++) {\r\n\t\t\tout.push(i*bytes);\r\n\t\t}\r\n\t\tout.push(b*bytes+last);\r\n\t\treturn out;\r\n\t }\r\n\t var finish=function() {\r\n\t\t rm(fn,function(){\r\n\t\t\t\tfileEntry.moveTo(fileEntry.filesystem.root, fn,function(){\r\n\t\t\t\t\tsetTimeout( cb.bind(context,false) , 0) ;\r\n\t\t\t\t},function(e){\r\n\t\t\t\t\tconsole.log(\"failed\",e)\r\n\t\t\t\t});\r\n\t\t },this);\r\n\t };\r\n\t\tvar tempfn=\"temp.kdb\";\r\n\t\tvar batch=function(b) {\r\n\t\tvar abort=false;\r\n\t\tvar xhr = new XMLHttpRequest();\r\n\t\tvar requesturl=url+\"?\"+Math.random();\r\n\t\txhr.open('get', requesturl, true);\r\n\t\txhr.setRequestHeader('Range', 'bytes='+batches[b]+'-'+(batches[b+1]-1));\r\n\t\txhr.responseType = 'blob';\r\n\t\txhr.addEventListener('load', function() {\r\n\t\t\tvar blob=this.response;\r\n\t\t\tfileEntry.createWriter(function(fileWriter) {\r\n\t\t\t\tfileWriter.seek(fileWriter.length);\r\n\t\t\t\tfileWriter.write(blob);\r\n\t\t\t\twritten+=blob.size;\r\n\t\t\t\tfileWriter.onwriteend = function(e) {\r\n\t\t\t\t\tif (statuscb) {\r\n\t\t\t\t\t\tabort=statuscb.apply(context,[ fileWriter.length / totalsize,totalsize ]);\r\n\t\t\t\t\t\tif (abort) setTimeout( cb.bind(context,false) , 0) ;\r\n\t\t\t\t \t}\r\n\t\t\t\t\tb++;\r\n\t\t\t\t\tif (!abort) {\r\n\t\t\t\t\t\tif (b<batches.length-1) setTimeout(batch.bind(context,b),0);\r\n\t\t\t\t\t\telse finish();\r\n\t\t\t\t \t}\r\n\t\t\t \t};\r\n\t\t\t}, console.error);\r\n\t\t},false);\r\n\t\txhr.send();\r\n\t}\r\n\r\n\tget_size(url,function(size){\r\n\t\ttotalsize=size;\r\n\t\tif (!size) {\r\n\t\t\tif (cb) cb.apply(context,[false]);\r\n\t\t} else {//ready to download\r\n\t\t\trm(tempfn,function(){\r\n\t\t\t\t batches=createBatches(size);\r\n\t\t\t\t if (statuscb) statuscb.apply(context,[ 0, totalsize ]);\r\n\t\t\t\t API.fs.root.getFile(tempfn, {create: 1, exclusive: false}, function(_fileEntry) {\r\n\t\t\t\t\t\t\tfileEntry=_fileEntry;\r\n\t\t\t\t\t\tbatch(0);\r\n\t\t\t\t });\r\n\t\t\t},this);\r\n\t\t}\r\n\t});\r\n}\r\n\r\nvar readFile=function(filename,cb,context) {\r\n\tAPI.fs.root.getFile(filename, {create: false, exclusive: false},function(fileEntry) {\r\n\t\tfileEntry.file(function(file){\r\n\t\t\tvar reader = new FileReader();\r\n\t\t\treader.onloadend = function(e) {\r\n\t\t\t\tif (cb) cb.call(cb,this.result);\r\n\t\t\t};\r\n\t\t\treader.readAsText(file,\"utf8\");\r\n\t\t});\r\n\t}, console.error);\r\n}\r\n\r\nfunction createDir(rootDirEntry, folders, cb) {\r\n // Throw out './' or '/' and move on to prevent something like '/foo/.//bar'.\r\n if (folders[0] == '.' || folders[0] == '') {\r\n folders = folders.slice(1);\r\n }\r\n rootDirEntry.getDirectory(folders[0], {create: true}, function(dirEntry) {\r\n // Recursively add the new subfolder (if we still have another to create).\r\n if (folders.length) {\r\n createDir(dirEntry, folders.slice(1),cb);\r\n } else {\r\n\t\t\tcb();\r\n\t\t}\r\n }, cb);\r\n};\r\n\r\n\r\nvar writeFile=function(filename,buf,cb,context){\r\n\tvar write=function(fileEntry){\r\n\t\tfileEntry.createWriter(function(fileWriter) {\r\n\t\t\tfileWriter.write(buf);\r\n\t\t\tfileWriter.onwriteend = function(e) {\r\n\t\t\t\tif (cb) cb.apply(cb,[buf.byteLength]);\r\n\t\t\t};\r\n\t\t}, console.error);\r\n\t}\r\n\r\n\tvar getFile=function(filename){\r\n\t\tAPI.fs.root.getFile(filename, {exclusive:true}, function(fileEntry) {\r\n\t\t\twrite(fileEntry);\r\n\t\t}, function(){\r\n\t\t\t\tAPI.fs.root.getFile(filename, {create:true,exclusive:true}, function(fileEntry) {\r\n\t\t\t\t\twrite(fileEntry);\r\n\t\t\t\t});\r\n\r\n\t\t});\r\n\t}\r\n\tvar slash=filename.lastIndexOf(\"/\");\r\n\tif (slash>-1) {\r\n\t\tcreateDir(API.fs.root, filename.substr(0,slash).split(\"/\"),function(){\r\n\t\t\tgetFile(filename);\r\n\t\t});\r\n\t} else {\r\n\t\tgetFile(filename);\r\n\t}\r\n}\r\n\r\nvar readdir=function(cb,context) {\r\n\tvar dirReader = API.fs.root.createReader();\r\n\tvar out=[],that=this;\r\n\tdirReader.readEntries(function(entries) {\r\n\t\tif (entries.length) {\r\n\t\t\tfor (var i = 0, entry; entry = entries[i]; ++i) {\r\n\t\t\t\tif (entry.isFile) {\r\n\t\t\t\t\tout.push([entry.name,entry.toURL ? entry.toURL() : entry.toURI()]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tAPI.files=out;\r\n\t\tif (cb) cb.apply(context,[out]);\r\n\t}, function(){\r\n\t\tif (cb) cb.apply(context,[null]);\r\n\t});\r\n}\r\nvar getFileURL=function(filename) {\r\n\tif (!API.files ) return null;\r\n\tvar file= API.files.filter(function(f){return f[0]==filename});\r\n\tif (file.length) return file[0][1];\r\n}\r\nvar rm=function(filename,cb,context) {\r\n\tvar url=getFileURL(filename);\r\n\tif (url) rmURL(url,cb,context);\r\n\telse if (cb) cb.apply(context,[false]);\r\n}\r\n\r\nvar rmURL=function(filename,cb,context) {\r\n\twebkitResolveLocalFileSystemURL(filename, function(fileEntry) {\r\n\t\tfileEntry.remove(function() {\r\n\t\t\tif (cb) cb.apply(context,[true]);\r\n\t\t}, console.error);\r\n\t}, function(e){\r\n\t\tif (cb) cb.apply(context,[false]);//no such file\r\n\t});\r\n}\r\nfunction errorHandler(e) {\r\n\tconsole.error('Error: ' +e.name+ \" \"+e.message);\r\n}\r\nvar initfs=function(grantedBytes,cb,context) {\r\n\twebkitRequestFileSystem(PERSISTENT, grantedBytes, function(fs) {\r\n\t\tAPI.fs=fs;\r\n\t\tAPI.quota=grantedBytes;\r\n\t\treaddir(function(){\r\n\t\t\tAPI.initialized=true;\r\n\t\t\tcb.apply(context,[grantedBytes,fs]);\r\n\t\t},context);\r\n\t}, errorHandler);\r\n}\r\nvar init=function(quota,cb,context) {\r\n\tnavigator.webkitPersistentStorage.requestQuota(quota,\r\n\t\t\tfunction(grantedBytes) {\r\n\t\t\t\tinitfs(grantedBytes,cb,context);\r\n\t\t}, errorHandler\r\n\t);\r\n}\r\nvar queryQuota=function(cb,context) {\r\n\tvar that=this;\r\n\tnavigator.webkitPersistentStorage.queryUsageAndQuota(\r\n\t function(usage,quota){\r\n\t\t\tinitfs(quota,function(){\r\n\t\t\t\tcb.apply(context,[usage,quota]);\r\n\t\t\t},context);\r\n\t});\r\n}\r\nvar API={\r\n\tinit:init\r\n\t,readdir:readdir\r\n\t,checkUpdate:checkUpdate\r\n\t,rm:rm\r\n\t,rmURL:rmURL\r\n\t,getFileURL:getFileURL\r\n\t,writeFile:writeFile\r\n\t,readFile:readFile\r\n\t,download:download\r\n\t,get_head:get_head\r\n\t,get_date:get_date\r\n\t,get_size:get_size\r\n\t,getDownloadSize:get_size\r\n\t,queryQuota:queryQuota\r\n}\r\nmodule.exports=API;\r\n",
"var appname=\"installer\";\r\nif (typeof ksana==\"undefined\") {\r\n\twindow.ksana={platform:\"chrome\"};\r\n\tif (typeof process!==\"undefined\" && \r\n\t\tprocess.versions && process.versions[\"node-webkit\"]) {\r\n\t\twindow.ksana.platform=\"node-webkit\";\r\n\t}\r\n}\r\nvar switchApp=function(path) {\r\n\tvar fs=require(\"fs\");\r\n\tpath=\"../\"+path;\r\n\tappname=path;\r\n\tdocument.location.href= path+\"/index.html\"; \r\n\tprocess.chdir(path);\r\n}\r\nvar downloader={};\r\nvar rootPath=\"\";\r\n\r\nvar deleteApp=function(app) {\r\n\tconsole.error(\"not allow on PC, do it in File Explorer/ Finder\");\r\n}\r\nvar username=function() {\r\n\treturn \"\";\r\n}\r\nvar useremail=function() {\r\n\treturn \"\"\r\n}\r\nvar runtime_version=function() {\r\n\treturn \"1.4\";\r\n}\r\n\r\n//copy from liveupdate\r\nvar jsonp=function(url,dbid,callback,context) {\r\n var script=document.getElementById(\"jsonp2\");\r\n if (script) {\r\n script.parentNode.removeChild(script);\r\n }\r\n window.jsonp_handler=function(data) {\r\n if (typeof data==\"object\") {\r\n data.dbid=dbid;\r\n callback.apply(context,[data]); \r\n } \r\n }\r\n window.jsonp_error_handler=function() {\r\n console.error(\"url unreachable\",url);\r\n callback.apply(context,[null]);\r\n }\r\n script=document.createElement('script');\r\n script.setAttribute('id', \"jsonp2\");\r\n script.setAttribute('onerror', \"jsonp_error_handler()\");\r\n url=url+'?'+(new Date().getTime());\r\n script.setAttribute('src', url);\r\n document.getElementsByTagName('head')[0].appendChild(script); \r\n}\r\n\r\n\r\nvar loadKsanajs=function(){\r\n\r\n\tif (typeof process!=\"undefined\" && !process.browser) {\r\n\t\tvar ksanajs=require(\"fs\").readFileSync(\"./ksana.js\",\"utf8\").trim();\r\n\t\tdownloader=require(\"./downloader\");\r\n\t\tksana.js=JSON.parse(ksanajs.substring(14,ksanajs.length-1));\r\n\t\trootPath=process.cwd();\r\n\t\trootPath=require(\"path\").resolve(rootPath,\"..\").replace(/\\\\/g,\"/\")+'/';\r\n\t\tksana.ready=true;\r\n\t} else{\r\n\t\tvar url=window.location.origin+window.location.pathname.replace(\"index.html\",\"\")+\"ksana.js\";\r\n\t\tjsonp(url,appname,function(data){\r\n\t\t\tksana.js=data;\r\n\t\t\tksana.ready=true;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nloadKsanajs();\r\n\r\nvar boot=function(appId,cb) {\r\n\tif (typeof appId==\"function\") {\r\n\t\tcb=appId;\r\n\t\tappId=\"unknownapp\";\r\n\t}\r\n\tif (!ksana.js && ksana.platform==\"node-webkit\") {\r\n\t\tloadKsanajs();\r\n\t}\r\n\tksana.appId=appId;\r\n\tif (ksana.ready) {\r\n\t\tcb();\r\n\t\treturn;\r\n\t}\r\n\tvar timer=setInterval(function(){\r\n\t\t\tif (ksana.ready){\r\n\t\t\t\tclearInterval(timer);\r\n\t\t\t\tcb();\r\n\t\t\t}\r\n\t\t},100);\r\n}\r\n\r\n\r\nvar ksanagap={\r\n\tplatform:\"node-webkit\",\r\n\tstartDownload:downloader.startDownload,\r\n\tdownloadedByte:downloader.downloadedByte,\r\n\tdownloadingFile:downloader.downloadingFile,\r\n\tcancelDownload:downloader.cancelDownload,\r\n\tdoneDownload:downloader.doneDownload,\r\n\tswitchApp:switchApp,\r\n\trootPath:rootPath,\r\n\tdeleteApp: deleteApp,\r\n\tusername:username, //not support on PC\r\n\tuseremail:username,\r\n\truntime_version:runtime_version,\r\n\tboot:boot\r\n}\r\nmodule.exports=ksanagap;",
"var started=false;\r\nvar timer=null;\r\nvar bundledate=null;\r\nvar get_date=require(\"./html5fs\").get_date;\r\nvar checkIfBundleUpdated=function() {\r\n\tget_date(\"bundle.js\",function(date){\r\n\t\tif (bundledate &&bundledate!=date){\r\n\t\t\tlocation.reload();\r\n\t\t}\r\n\t\tbundledate=date;\r\n\t});\r\n}\r\nvar livereload=function() {\r\n\tif(window.location.origin.indexOf(\"//127.0.0.1\")===-1) return;\r\n\r\n\tif (started) return;\r\n\r\n\ttimer1=setInterval(function(){\r\n\t\tcheckIfBundleUpdated();\r\n\t},2000);\r\n\tstarted=true;\r\n}\r\n\r\nmodule.exports=livereload;",
"function mkdirP (p, mode, f, made) {\r\n var path = nodeRequire('path');\r\n var fs = nodeRequire('fs');\r\n\t\r\n if (typeof mode === 'function' || mode === undefined) {\r\n f = mode;\r\n mode = 0x1FF & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n\r\n var cb = f || function () {};\r\n if (typeof mode === 'string') mode = parseInt(mode, 8);\r\n p = path.resolve(p);\r\n\r\n fs.mkdir(p, mode, function (er) {\r\n if (!er) {\r\n made = made || p;\r\n return cb(null, made);\r\n }\r\n switch (er.code) {\r\n case 'ENOENT':\r\n mkdirP(path.dirname(p), mode, function (er, made) {\r\n if (er) cb(er, made);\r\n else mkdirP(p, mode, cb, made);\r\n });\r\n break;\r\n\r\n // In the case of any other error, just see if there's a dir\r\n // there already. If so, then hooray! If not, then something\r\n // is borked.\r\n default:\r\n fs.stat(p, function (er2, stat) {\r\n // if the stat fails, then that's super weird.\r\n // let the original error be the failure reason.\r\n if (er2 || !stat.isDirectory()) cb(er, made)\r\n else cb(null, made);\r\n });\r\n break;\r\n }\r\n });\r\n}\r\n\r\nmkdirP.sync = function sync (p, mode, made) {\r\n var path = nodeRequire('path');\r\n var fs = nodeRequire('fs');\r\n if (mode === undefined) {\r\n mode = 0x1FF & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n\r\n if (typeof mode === 'string') mode = parseInt(mode, 8);\r\n p = path.resolve(p);\r\n\r\n try {\r\n fs.mkdirSync(p, mode);\r\n made = made || p;\r\n }\r\n catch (err0) {\r\n switch (err0.code) {\r\n case 'ENOENT' :\r\n made = sync(path.dirname(p), mode, made);\r\n sync(p, mode, made);\r\n break;\r\n\r\n // In the case of any other error, just see if there's a dir\r\n // there already. If so, then hooray! If not, then something\r\n // is borked.\r\n default:\r\n var stat;\r\n try {\r\n stat = fs.statSync(p);\r\n }\r\n catch (err1) {\r\n throw err0;\r\n }\r\n if (!stat.isDirectory()) throw err0;\r\n break;\r\n }\r\n }\r\n\r\n return made;\r\n};\r\n\r\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\r\n",
"module.exports = require('./src');\n",
"'use strict';\n\n/**\n * Representation of a single EventEmitter function.\n *\n * @param {Function} fn Event handler to be called.\n * @param {Mixed} context Context for function execution.\n * @param {Boolean} once Only emit once\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal EventEmitter interface that is molded against the Node.js\n * EventEmitter interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() { /* Nothing to set */ }\n\n/**\n * Holds the assigned EventEmitters by name.\n *\n * @type {Object}\n * @private\n */\nEventEmitter.prototype._events = undefined;\n\n/**\n * Return a list of assigned event listeners.\n *\n * @param {String} event The events that should be listed.\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n if (!this._events || !this._events[event]) return [];\n if (this._events[event].fn) return [this._events[event].fn];\n\n for (var i = 0, l = this._events[event].length, ee = new Array(l); i < l; i++) {\n ee[i] = this._events[event][i].fn;\n }\n\n return ee;\n};\n\n/**\n * Emit an event to all registered event listeners.\n *\n * @param {String} event The name of the event.\n * @returns {Boolean} Indication if we've emitted an event.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n if (!this._events || !this._events[event]) return false;\n\n var listeners = this._events[event]\n , len = arguments.length\n , args\n , i;\n\n if ('function' === typeof listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Register a new EventListener for the given event.\n *\n * @param {String} event Name of the event.\n * @param {Functon} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this);\n\n if (!this._events) this._events = {};\n if (!this._events[event]) this._events[event] = listener;\n else {\n if (!this._events[event].fn) this._events[event].push(listener);\n else this._events[event] = [\n this._events[event], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Add an EventListener that's only called once.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true);\n\n if (!this._events) this._events = {};\n if (!this._events[event]) this._events[event] = listener;\n else {\n if (!this._events[event].fn) this._events[event].push(listener);\n else this._events[event] = [\n this._events[event], listener\n ];\n }\n\n return this;\n};\n\n/**\n * Remove event listeners.\n *\n * @param {String} event The event we want to remove.\n * @param {Function} fn The listener that we need to find.\n * @param {Boolean} once Only remove once listeners.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, once) {\n if (!this._events || !this._events[event]) return this;\n\n var listeners = this._events[event]\n , events = [];\n\n if (fn) {\n if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) {\n events.push(listeners);\n }\n if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) {\n if (listeners[i].fn !== fn || (once && !listeners[i].once)) {\n events.push(listeners[i]);\n }\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) {\n this._events[event] = events.length === 1 ? events[0] : events;\n } else {\n delete this._events[event];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners or only the listeners for the specified event.\n *\n * @param {String} event The event want to remove all listeners for.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n if (!this._events) return this;\n\n if (event) delete this._events[event];\n else this._events = {};\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the module.\n//\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.EventEmitter2 = EventEmitter;\nEventEmitter.EventEmitter3 = EventEmitter;\n\n//\n// Expose the module.\n//\nmodule.exports = EventEmitter;\n",
"/*! Native Promise Only\n v0.7.6-a (c) Kyle Simpson\n MIT License: http://getify.mit-license.org\n*/\n!function(t,n,e){n[t]=n[t]||e(),\"undefined\"!=typeof module&&module.exports?module.exports=n[t]:\"function\"==typeof define&&define.amd&&define(function(){return n[t]})}(\"Promise\",\"undefined\"!=typeof global?global:this,function(){\"use strict\";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||\"object\"!=e&&\"function\"!=e||(n=t.then),\"function\"==typeof n?n:!1}function e(){for(var t=0;t<this.chain.length;t++)o(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function o(t,e,o){var r,i;try{e===!1?o.reject(t.msg):(r=e===!0?t.msg:e.call(void 0,t.msg),r===o.promise?o.reject(TypeError(\"Promise-chain cycle\")):(i=n(r))?i.call(r,o.resolve,o.reject):o.resolve(r))}catch(c){o.reject(c)}}function r(o){var c,u,a=this;if(!a.triggered){a.triggered=!0,a.def&&(a=a.def);try{(c=n(o))?(u=new f(a),c.call(o,function(){r.apply(u,arguments)},function(){i.apply(u,arguments)})):(a.msg=o,a.state=1,a.chain.length>0&&t(e,a))}catch(s){i.call(u||new f(a),s)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r<n.length;r++)!function(r){t.resolve(n[r]).then(function(t){e(r,t)},o)}(r)}function f(t){this.def=t,this.triggered=!1}function u(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function a(n){if(\"function\"!=typeof n)throw TypeError(\"Not a function\");if(0!==this.__NPO__)throw TypeError(\"Not a promise\");this.__NPO__=1;var o=new u(this);this.then=function(n,r){var i={success:\"function\"==typeof n?n:!0,failure:\"function\"==typeof r?r:!1};return i.promise=new this.constructor(function(t,n){if(\"function\"!=typeof t||\"function\"!=typeof n)throw TypeError(\"Not a function\");i.resolve=t,i.reject=n}),o.chain.push(i),0!==o.state&&t(e,o),i.promise},this[\"catch\"]=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){r.call(o,t)},function(t){i.call(o,t)})}catch(c){i.call(o,c)}}var s,h,l,p=Object.prototype.toString,y=\"undefined\"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},\"x\",{}),s=function(t,n,e,o){return Object.defineProperty(t,n,{value:e,writable:!0,configurable:o!==!1})}}catch(d){s=function(t,n,e){return t[n]=e,t}}l=function(){function t(t,n){this.fn=t,this.self=n,this.next=void 0}var n,e,o;return{add:function(r,i){o=new t(r,i),e?e.next=o:n=o,e=o,o=void 0},drain:function(){var t=n;for(n=e=h=void 0;t;)t.fn.call(t.self),t=t.next}}}();var g=s({},\"constructor\",a,!1);return s(a,\"prototype\",g,!1),s(g,\"__NPO__\",0,!1),s(a,\"resolve\",function(t){var n=this;return t&&\"object\"==typeof t&&1===t.__NPO__?t:new n(function(n,e){if(\"function\"!=typeof n||\"function\"!=typeof e)throw TypeError(\"Not a function\");n(t)})}),s(a,\"reject\",function(t){return new this(function(n,e){if(\"function\"!=typeof n||\"function\"!=typeof e)throw TypeError(\"Not a function\");e(t)})}),s(a,\"all\",function(t){var n=this;return\"[object Array]\"!=p.call(t)?n.reject(TypeError(\"Not an array\")):0===t.length?n.resolve([]):new n(function(e,o){if(\"function\"!=typeof e||\"function\"!=typeof o)throw TypeError(\"Not a function\");var r=t.length,i=Array(r),f=0;c(n,t,function(t,n){i[t]=n,++f===r&&e(i)},o)})}),s(a,\"race\",function(t){var n=this;return\"[object Array]\"!=p.call(t)?n.reject(TypeError(\"Not an array\")):new n(function(e,o){if(\"function\"!=typeof e||\"function\"!=typeof o)throw TypeError(\"Not a function\");c(n,t,function(t,n){e(n)},o)})}),a});\n",
"/**\n * A module of methods that you want to include in all actions.\n * This module is consumed by `createAction`.\n */\nmodule.exports = {\n};\n",
"exports.createdStores = [];\n\nexports.createdActions = [];\n\nexports.reset = function() {\n while(exports.createdStores.length) {\n exports.createdStores.pop();\n }\n while(exports.createdActions.length) {\n exports.createdActions.pop();\n }\n};\n",
"var _ = require('./utils'),\n maker = require('./joins').instanceJoinCreator;\n\n/**\n * Extract child listenables from a parent from their\n * children property and return them in a keyed Object\n *\n * @param {Object} listenable The parent listenable\n */\nvar mapChildListenables = function(listenable) {\n var i = 0, children = {}, childName;\n for (;i < (listenable.children||[]).length; ++i) {\n childName = listenable.children[i];\n if(listenable[childName]){\n children[childName] = listenable[childName];\n }\n }\n return children;\n};\n\n/**\n * Make a flat dictionary of all listenables including their\n * possible children (recursively), concatenating names in camelCase.\n *\n * @param {Object} listenables The top-level listenables\n */\nvar flattenListenables = function(listenables) {\n var flattened = {};\n for(var key in listenables){\n var listenable = listenables[key];\n var childMap = mapChildListenables(listenable);\n\n // recursively flatten children\n var children = flattenListenables(childMap);\n\n // add the primary listenable and chilren\n flattened[key] = listenable;\n for(var childKey in children){\n var childListenable = children[childKey];\n flattened[key + _.capitalize(childKey)] = childListenable;\n }\n }\n\n return flattened;\n};\n\n/**\n * A module of methods related to listening.\n */\nmodule.exports = {\n\n /**\n * An internal utility function used by `validateListening`\n *\n * @param {Action|Store} listenable The listenable we want to search for\n * @returns {Boolean} The result of a recursive search among `this.subscriptions`\n */\n hasListener: function(listenable) {\n var i = 0, j, listener, listenables;\n for (;i < (this.subscriptions||[]).length; ++i) {\n listenables = [].concat(this.subscriptions[i].listenable);\n for (j = 0; j < listenables.length; j++){\n listener = listenables[j];\n if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) {\n return true;\n }\n }\n }\n return false;\n },\n\n /**\n * A convenience method that listens to all listenables in the given object.\n *\n * @param {Object} listenables An object of listenables. Keys will be used as callback method names.\n */\n listenToMany: function(listenables){\n var allListenables = flattenListenables(listenables);\n for(var key in allListenables){\n var cbname = _.callbackName(key),\n localname = this[cbname] ? cbname : this[key] ? key : undefined;\n if (localname){\n this.listenTo(allListenables[key],localname,this[cbname+\"Default\"]||this[localname+\"Default\"]||localname);\n }\n }\n },\n\n /**\n * Checks if the current context can listen to the supplied listenable\n *\n * @param {Action|Store} listenable An Action or Store that should be\n * listened to.\n * @returns {String|Undefined} An error message, or undefined if there was no problem.\n */\n validateListening: function(listenable){\n if (listenable === this) {\n return \"Listener is not able to listen to itself\";\n }\n if (!_.isFunction(listenable.listen)) {\n return listenable + \" is missing a listen method\";\n }\n if (listenable.hasListener && listenable.hasListener(this)) {\n return \"Listener cannot listen to this listenable because of circular loop\";\n }\n },\n\n /**\n * Sets up a subscription to the given listenable for the context object\n *\n * @param {Action|Store} listenable An Action or Store that should be\n * listened to.\n * @param {Function|String} callback The callback to register as event handler\n * @param {Function|String} defaultCallback The callback to register as default handler\n * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to\n */\n listenTo: function(listenable, callback, defaultCallback) {\n var desub, unsubscriber, subscriptionobj, subs = this.subscriptions = this.subscriptions || [];\n _.throwIf(this.validateListening(listenable));\n this.fetchInitialState(listenable, defaultCallback);\n desub = listenable.listen(this[callback]||callback, this);\n unsubscriber = function() {\n var index = subs.indexOf(subscriptionobj);\n _.throwIf(index === -1,'Tried to remove listen already gone from subscriptions list!');\n subs.splice(index, 1);\n desub();\n };\n subscriptionobj = {\n stop: unsubscriber,\n listenable: listenable\n };\n subs.push(subscriptionobj);\n return subscriptionobj;\n },\n\n /**\n * Stops listening to a single listenable\n *\n * @param {Action|Store} listenable The action or store we no longer want to listen to\n * @returns {Boolean} True if a subscription was found and removed, otherwise false.\n */\n stopListeningTo: function(listenable){\n var sub, i = 0, subs = this.subscriptions || [];\n for(;i < subs.length; i++){\n sub = subs[i];\n if (sub.listenable === listenable){\n sub.stop();\n _.throwIf(subs.indexOf(sub)!==-1,'Failed to remove listen from subscriptions list!');\n return true;\n }\n }\n return false;\n },\n\n /**\n * Stops all subscriptions and empties subscriptions array\n */\n stopListeningToAll: function(){\n var remaining, subs = this.subscriptions || [];\n while((remaining=subs.length)){\n subs[0].stop();\n _.throwIf(subs.length!==remaining-1,'Failed to remove listen from subscriptions list!');\n }\n },\n\n /**\n * Used in `listenTo`. Fetches initial data from a publisher if it has a `getInitialState` method.\n * @param {Action|Store} listenable The publisher we want to get initial state from\n * @param {Function|String} defaultCallback The method to receive the data\n */\n fetchInitialState: function (listenable, defaultCallback) {\n defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback;\n var me = this;\n if (_.isFunction(defaultCallback) && _.isFunction(listenable.getInitialState)) {\n var data = listenable.getInitialState();\n if (data && _.isFunction(data.then)) {\n data.then(function() {\n defaultCallback.apply(me, arguments);\n });\n } else {\n defaultCallback.call(this, data);\n }\n }\n },\n\n /**\n * The callback will be called once all listenables have triggered at least once.\n * It will be invoked with the last emission from each listenable.\n * @param {...Publishers} publishers Publishers that should be tracked.\n * @param {Function|String} callback The method to call when all publishers have emitted\n * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables\n */\n joinTrailing: maker(\"last\"),\n\n /**\n * The callback will be called once all listenables have triggered at least once.\n * It will be invoked with the first emission from each listenable.\n * @param {...Publishers} publishers Publishers that should be tracked.\n * @param {Function|String} callback The method to call when all publishers have emitted\n * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables\n */\n joinLeading: maker(\"first\"),\n\n /**\n * The callback will be called once all listenables have triggered at least once.\n * It will be invoked with all emission from each listenable.\n * @param {...Publishers} publishers Publishers that should be tracked.\n * @param {Function|String} callback The method to call when all publishers have emitted\n * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables\n */\n joinConcat: maker(\"all\"),\n\n /**\n * The callback will be called once all listenables have triggered.\n * If a callback triggers twice before that happens, an error is thrown.\n * @param {...Publishers} publishers Publishers that should be tracked.\n * @param {Function|String} callback The method to call when all publishers have emitted\n * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is an array of listenables\n */\n joinStrict: maker(\"strict\")\n};\n",
"var _ = require('./utils'),\n ListenerMethods = require('./ListenerMethods');\n\n/**\n * A module meant to be consumed as a mixin by a React component. Supplies the methods from\n * `ListenerMethods` mixin and takes care of teardown of subscriptions.\n * Note that if you're using the `connect` mixin you don't need this mixin, as connect will\n * import everything this mixin contains!\n */\nmodule.exports = _.extend({\n\n /**\n * Cleans up all listener previously registered.\n */\n componentWillUnmount: ListenerMethods.stopListeningToAll\n\n}, ListenerMethods);\n",
"var _ = require('./utils');\n\n/**\n * A module of methods for object that you want to be able to listen to.\n * This module is consumed by `createStore` and `createAction`\n */\nmodule.exports = {\n\n /**\n * Hook used by the publisher that is invoked before emitting\n * and before `shouldEmit`. The arguments are the ones that the action\n * is invoked with. If this function returns something other than\n * undefined, that will be passed on as arguments for shouldEmit and\n * emission.\n */\n preEmit: function() {},\n\n /**\n * Hook used by the publisher after `preEmit` to determine if the\n * event should be emitted with given arguments. This may be overridden\n * in your application, default implementation always returns true.\n *\n * @returns {Boolean} true if event should be emitted\n */\n shouldEmit: function() { return true; },\n\n /**\n * Subscribes the given callback for action triggered\n *\n * @param {Function} callback The callback to register as event handler\n * @param {Mixed} [optional] bindContext The context to bind the callback with\n * @returns {Function} Callback that unsubscribes the registered event handler\n */\n listen: function(callback, bindContext) {\n bindContext = bindContext || this;\n var eventHandler = function(args) {\n if (aborted){\n return;\n }\n callback.apply(bindContext, args);\n }, me = this, aborted = false;\n this.emitter.addListener(this.eventLabel, eventHandler);\n return function() {\n aborted = true;\n me.emitter.removeListener(me.eventLabel, eventHandler);\n };\n },\n\n /**\n * Attach handlers to promise that trigger the completed and failed\n * child publishers, if available.\n *\n * @param {Object} The promise to attach to\n */\n promise: function(promise) {\n var me = this;\n\n var canHandlePromise =\n this.children.indexOf('completed') >= 0 &&\n this.children.indexOf('failed') >= 0;\n\n if (!canHandlePromise){\n throw new Error('Publisher must have \"completed\" and \"failed\" child publishers');\n }\n\n promise.then(function(response) {\n return me.completed(response);\n }, function(error) {\n return me.failed(error);\n });\n },\n\n /**\n * Subscribes the given callback for action triggered, which should\n * return a promise that in turn is passed to `this.promise`\n *\n * @param {Function} callback The callback to register as event handler\n */\n listenAndPromise: function(callback, bindContext) {\n var me = this;\n bindContext = bindContext || this;\n this.willCallPromise = (this.willCallPromise || 0) + 1;\n\n var removeListen = this.listen(function() {\n\n if (!callback) {\n throw new Error('Expected a function returning a promise but got ' + callback);\n }\n\n var args = arguments,\n promise = callback.apply(bindContext, args);\n return me.promise.call(me, promise);\n }, bindContext);\n\n return function () {\n me.willCallPromise--;\n removeListen.call(me);\n };\n\n },\n\n /**\n * Publishes an event using `this.emitter` (if `shouldEmit` agrees)\n */\n trigger: function() {\n var args = arguments,\n pre = this.preEmit.apply(this, args);\n args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre);\n if (this.shouldEmit.apply(this, args)) {\n this.emitter.emit(this.eventLabel, args);\n }\n },\n\n /**\n * Tries to publish the event on the next tick\n */\n triggerAsync: function(){\n var args = arguments,me = this;\n _.nextTick(function() {\n me.trigger.apply(me, args);\n });\n },\n\n /**\n * Returns a Promise for the triggered action\n *\n * @return {Promise}\n * Resolved by completed child action.\n * Rejected by failed child action.\n * If listenAndPromise'd, then promise associated to this trigger.\n * Otherwise, the promise is for next child action completion.\n */\n triggerPromise: function(){\n var me = this;\n var args = arguments;\n\n var canHandlePromise =\n this.children.indexOf('completed') >= 0 &&\n this.children.indexOf('failed') >= 0;\n\n var promise = _.createPromise(function(resolve, reject) {\n // If `listenAndPromise` is listening\n // patch `promise` w/ context-loaded resolve/reject\n if (me.willCallPromise) {\n _.nextTick(function() {\n var old_promise_method = me.promise;\n me.promise = function (promise) {\n promise.then(resolve, reject);\n // Back to your regularly schedule programming.\n me.promise = old_promise_method;\n return me.promise.apply(me, arguments);\n };\n me.trigger.apply(me, args);\n });\n return;\n }\n\n if (canHandlePromise) {\n var removeSuccess = me.completed.listen(function(args) {\n removeSuccess();\n removeFailed();\n resolve(args);\n });\n\n var removeFailed = me.failed.listen(function(args) {\n removeSuccess();\n removeFailed();\n reject(args);\n });\n }\n\n me.triggerAsync.apply(me, args);\n\n if (!canHandlePromise) {\n resolve();\n }\n });\n\n return promise;\n }\n};\n",
"/**\n * A module of methods that you want to include in all stores.\n * This module is consumed by `createStore`.\n */\nmodule.exports = {\n};\n",
"module.exports = function(store, definition) {\n for (var name in definition) {\n if (Object.getOwnPropertyDescriptor && Object.defineProperty) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(definition, name);\n\n if (!propertyDescriptor.value || typeof propertyDescriptor.value !== 'function' || !definition.hasOwnProperty(name)) {\n continue;\n }\n\n store[name] = definition[name].bind(store);\n } else {\n var property = definition[name];\n\n if (typeof property !== 'function' || !definition.hasOwnProperty(name)) {\n continue;\n }\n\n store[name] = property.bind(store);\n }\n }\n\n return store;\n};\n",
"var Reflux = require('./index'),\n _ = require('./utils');\n\nmodule.exports = function(listenable,key){\n return {\n getInitialState: function(){\n if (!_.isFunction(listenable.getInitialState)) {\n return {};\n } else if (key === undefined) {\n return listenable.getInitialState();\n } else {\n return _.object([key],[listenable.getInitialState()]);\n }\n },\n componentDidMount: function(){\n _.extend(this,Reflux.ListenerMethods);\n var me = this, cb = (key === undefined ? this.setState : function(v){me.setState(_.object([key],[v]));});\n this.listenTo(listenable,cb);\n },\n componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount\n };\n};\n",
"var Reflux = require('./index'),\n _ = require('./utils');\n\nmodule.exports = function(listenable, key, filterFunc) {\n filterFunc = _.isFunction(key) ? key : filterFunc;\n return {\n getInitialState: function() {\n if (!_.isFunction(listenable.getInitialState)) {\n return {};\n } else if (_.isFunction(key)) {\n return filterFunc.call(this, listenable.getInitialState());\n } else {\n // Filter initial payload from store.\n var result = filterFunc.call(this, listenable.getInitialState());\n if (result) {\n return _.object([key], [result]);\n } else {\n return {};\n }\n }\n },\n componentDidMount: function() {\n _.extend(this, Reflux.ListenerMethods);\n var me = this;\n var cb = function(value) {\n if (_.isFunction(key)) {\n me.setState(filterFunc.call(me, value));\n } else {\n var result = filterFunc.call(me, value);\n me.setState(_.object([key], [result]));\n }\n };\n\n this.listenTo(listenable, cb);\n },\n componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount\n };\n};\n\n",
"var _ = require('./utils'),\n Reflux = require('./index'),\n Keep = require('./Keep'),\n allowed = {preEmit:1,shouldEmit:1};\n\n/**\n * Creates an action functor object. It is mixed in with functions\n * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may\n * be overridden in the definition object.\n *\n * @param {Object} definition The action object definition\n */\nvar createAction = function(definition) {\n\n definition = definition || {};\n if (!_.isObject(definition)){\n definition = {actionName: definition};\n }\n\n for(var a in Reflux.ActionMethods){\n if (!allowed[a] && Reflux.PublisherMethods[a]) {\n throw new Error(\"Cannot override API method \" + a +\n \" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.\"\n );\n }\n }\n\n for(var d in definition){\n if (!allowed[d] && Reflux.PublisherMethods[d]) {\n throw new Error(\"Cannot override API method \" + d +\n \" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.\"\n );\n }\n }\n\n definition.children = definition.children || [];\n if (definition.asyncResult){\n definition.children = definition.children.concat([\"completed\",\"failed\"]);\n }\n\n var i = 0, childActions = {};\n for (; i < definition.children.length; i++) {\n var name = definition.children[i];\n childActions[name] = createAction(name);\n }\n\n var context = _.extend({\n eventLabel: \"action\",\n emitter: new _.EventEmitter(),\n _isAction: true\n }, Reflux.PublisherMethods, Reflux.ActionMethods, definition);\n\n var functor = function() {\n return functor[functor.sync?\"trigger\":\"triggerPromise\"].apply(functor, arguments);\n };\n\n _.extend(functor,childActions,context);\n\n Keep.createdActions.push(functor);\n\n return functor;\n\n};\n\nmodule.exports = createAction;\n",
"var _ = require('./utils'),\n Reflux = require('./index'),\n Keep = require('./Keep'),\n mixer = require('./mixer'),\n allowed = {preEmit:1,shouldEmit:1},\n bindMethods = require('./bindMethods');\n\n/**\n * Creates an event emitting Data Store. It is mixed in with functions\n * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit`\n * and `shouldEmit` may be overridden in the definition object.\n *\n * @param {Object} definition The data store object definition\n * @returns {Store} A data store instance\n */\nmodule.exports = function(definition) {\n\n definition = definition || {};\n\n for(var a in Reflux.StoreMethods){\n if (!allowed[a] && (Reflux.PublisherMethods[a] || Reflux.ListenerMethods[a])){\n throw new Error(\"Cannot override API method \" + a +\n \" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.\"\n );\n }\n }\n\n for(var d in definition){\n if (!allowed[d] && (Reflux.PublisherMethods[d] || Reflux.ListenerMethods[d])){\n throw new Error(\"Cannot override API method \" + d +\n \" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.\"\n );\n }\n }\n\n definition = mixer(definition);\n\n function Store() {\n var i=0, arr;\n this.subscriptions = [];\n this.emitter = new _.EventEmitter();\n this.eventLabel = \"change\";\n bindMethods(this, definition);\n if (this.init && _.isFunction(this.init)) {\n this.init();\n }\n if (this.listenables){\n arr = [].concat(this.listenables);\n for(;i < arr.length;i++){\n this.listenToMany(arr[i]);\n }\n }\n }\n\n _.extend(Store.prototype, Reflux.ListenerMethods, Reflux.PublisherMethods, Reflux.StoreMethods, definition);\n\n var store = new Store();\n Keep.createdStores.push(store);\n\n return store;\n};\n",
"exports.ActionMethods = require('./ActionMethods');\n\nexports.ListenerMethods = require('./ListenerMethods');\n\nexports.PublisherMethods = require('./PublisherMethods');\n\nexports.StoreMethods = require('./StoreMethods');\n\nexports.createAction = require('./createAction');\n\nexports.createStore = require('./createStore');\n\nexports.connect = require('./connect');\n\nexports.connectFilter = require('./connectFilter');\n\nexports.ListenerMixin = require('./ListenerMixin');\n\nexports.listenTo = require('./listenTo');\n\nexports.listenToMany = require('./listenToMany');\n\n\nvar maker = require('./joins').staticJoinCreator;\n\nexports.joinTrailing = exports.all = maker(\"last\"); // Reflux.all alias for backward compatibility\n\nexports.joinLeading = maker(\"first\");\n\nexports.joinStrict = maker(\"strict\");\n\nexports.joinConcat = maker(\"all\");\n\nvar _ = require('./utils');\n\nexports.EventEmitter = _.EventEmitter;\n\nexports.Promise = _.Promise;\n\n/**\n * Convenience function for creating a set of actions\n *\n * @param definitions the definitions for the actions to be created\n * @returns an object with actions of corresponding action names\n */\nexports.createActions = function(definitions) {\n var actions = {};\n for (var k in definitions){\n if (definitions.hasOwnProperty(k)) {\n var val = definitions[k],\n actionName = _.isObject(val) ? k : val;\n\n actions[actionName] = exports.createAction(val);\n }\n }\n return actions;\n};\n\n/**\n * Sets the eventmitter that Reflux uses\n */\nexports.setEventEmitter = function(ctx) {\n var _ = require('./utils');\n exports.EventEmitter = _.EventEmitter = ctx;\n};\n\n\n/**\n * Sets the Promise library that Reflux uses\n */\nexports.setPromise = function(ctx) {\n var _ = require('./utils');\n exports.Promise = _.Promise = ctx;\n};\n\n\n/**\n * Sets the Promise factory that creates new promises\n * @param {Function} factory has the signature `function(resolver) { return [new Promise]; }`\n */\nexports.setPromiseFactory = function(factory) {\n var _ = require('./utils');\n _.createPromise = factory;\n};\n\n\n/**\n * Sets the method used for deferring actions and stores\n */\nexports.nextTick = function(nextTick) {\n var _ = require('./utils');\n _.nextTick = nextTick;\n};\n\n/**\n * Provides the set of created actions and stores for introspection\n */\nexports.__keep = require('./Keep');\n\n/**\n * Warn if Function.prototype.bind not available\n */\nif (!Function.prototype.bind) {\n console.error(\n 'Function.prototype.bind not available. ' +\n 'ES5 shim required. ' +\n 'https://github.com/spoike/refluxjs#es5'\n );\n}\n",
"/**\n * Internal module used to create static and instance join methods\n */\n\nvar slice = Array.prototype.slice,\n _ = require(\"./utils\"),\n createStore = require(\"./createStore\"),\n strategyMethodNames = {\n strict: \"joinStrict\",\n first: \"joinLeading\",\n last: \"joinTrailing\",\n all: \"joinConcat\"\n };\n\n/**\n * Used in `index.js` to create the static join methods\n * @param {String} strategy Which strategy to use when tracking listenable trigger arguments\n * @returns {Function} A static function which returns a store with a join listen on the given listenables using the given strategy\n */\nexports.staticJoinCreator = function(strategy){\n return function(/* listenables... */) {\n var listenables = slice.call(arguments);\n return createStore({\n init: function(){\n this[strategyMethodNames[strategy]].apply(this,listenables.concat(\"triggerAsync\"));\n }\n });\n };\n};\n\n/**\n * Used in `ListenerMethods.js` to create the instance join methods\n * @param {String} strategy Which strategy to use when tracking listenable trigger arguments\n * @returns {Function} An instance method which sets up a join listen on the given listenables using the given strategy\n */\nexports.instanceJoinCreator = function(strategy){\n return function(/* listenables..., callback*/){\n _.throwIf(arguments.length < 3,'Cannot create a join with less than 2 listenables!');\n var listenables = slice.call(arguments),\n callback = listenables.pop(),\n numberOfListenables = listenables.length,\n join = {\n numberOfListenables: numberOfListenables,\n callback: this[callback]||callback,\n listener: this,\n strategy: strategy\n }, i, cancels = [], subobj;\n for (i = 0; i < numberOfListenables; i++) {\n _.throwIf(this.validateListening(listenables[i]));\n }\n for (i = 0; i < numberOfListenables; i++) {\n cancels.push(listenables[i].listen(newListener(i,join),this));\n }\n reset(join);\n subobj = {listenable: listenables};\n subobj.stop = makeStopper(subobj,cancels,this);\n this.subscriptions = (this.subscriptions || []).concat(subobj);\n return subobj;\n };\n};\n\n// ---- internal join functions ----\n\nfunction makeStopper(subobj,cancels,context){\n return function() {\n var i, subs = context.subscriptions,\n index = (subs ? subs.indexOf(subobj) : -1);\n _.throwIf(index === -1,'Tried to remove join already gone from subscriptions list!');\n for(i=0;i < cancels.length; i++){\n cancels[i]();\n }\n subs.splice(index, 1);\n };\n}\n\nfunction reset(join) {\n join.listenablesEmitted = new Array(join.numberOfListenables);\n join.args = new Array(join.numberOfListenables);\n}\n\nfunction newListener(i,join) {\n return function() {\n var callargs = slice.call(arguments);\n if (join.listenablesEmitted[i]){\n switch(join.strategy){\n case \"strict\": throw new Error(\"Strict join failed because listener triggered twice.\");\n case \"last\": join.args[i] = callargs; break;\n case \"all\": join.args[i].push(callargs);\n }\n } else {\n join.listenablesEmitted[i] = true;\n join.args[i] = (join.strategy===\"all\"?[callargs]:callargs);\n }\n emitIfAllListenablesEmitted(join);\n };\n}\n\nfunction emitIfAllListenablesEmitted(join) {\n for (var i = 0; i < join.numberOfListenables; i++) {\n if (!join.listenablesEmitted[i]) {\n return;\n }\n }\n join.callback.apply(join.listener,join.args);\n reset(join);\n}\n",
"var Reflux = require('./index');\n\n\n/**\n * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`,\n * without having to manually set listeners in the `componentDidMount` method.\n *\n * @param {Action|Store} listenable An Action or Store that should be\n * listened to.\n * @param {Function|String} callback The callback to register as event handler\n * @param {Function|String} defaultCallback The callback to register as default handler\n * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable.\n */\nmodule.exports = function(listenable,callback,initial){\n return {\n /**\n * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`\n * and then make the call to `listenTo` with the arguments provided to the factory function\n */\n componentDidMount: function() {\n for(var m in Reflux.ListenerMethods){\n if (this[m] !== Reflux.ListenerMethods[m]){\n if (this[m]){\n throw \"Can't have other property '\"+m+\"' when using Reflux.listenTo!\";\n }\n this[m] = Reflux.ListenerMethods[m];\n }\n }\n this.listenTo(listenable,callback,initial);\n },\n /**\n * Cleans up all listener previously registered.\n */\n componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll\n };\n};\n",
"var Reflux = require('./index');\n\n/**\n * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`,\n * without having to manually set listeners in the `componentDidMount` method. This version is used\n * to automatically set up a `listenToMany` call.\n *\n * @param {Object} listenables An object of listenables\n * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables.\n */\nmodule.exports = function(listenables){\n return {\n /**\n * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`\n * and then make the call to `listenTo` with the arguments provided to the factory function\n */\n componentDidMount: function() {\n for(var m in Reflux.ListenerMethods){\n if (this[m] !== Reflux.ListenerMethods[m]){\n if (this[m]){\n throw \"Can't have other property '\"+m+\"' when using Reflux.listenToMany!\";\n }\n this[m] = Reflux.ListenerMethods[m];\n }\n }\n this.listenToMany(listenables);\n },\n /**\n * Cleans up all listener previously registered.\n */\n componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll\n };\n};\n",
"var _ = require('./utils');\n\nmodule.exports = function mix(def) {\n var composed = {\n init: [],\n preEmit: [],\n shouldEmit: []\n };\n\n var updated = (function mixDef(mixin) {\n var mixed = {};\n if (mixin.mixins) {\n mixin.mixins.forEach(function (subMixin) {\n _.extend(mixed, mixDef(subMixin));\n });\n }\n _.extend(mixed, mixin);\n Object.keys(composed).forEach(function (composable) {\n if (mixin.hasOwnProperty(composable)) {\n composed[composable].push(mixin[composable]);\n }\n });\n return mixed;\n }(def));\n\n if (composed.init.length > 1) {\n updated.init = function () {\n var args = arguments;\n composed.init.forEach(function (init) {\n init.apply(this, args);\n }, this);\n };\n }\n if (composed.preEmit.length > 1) {\n updated.preEmit = function () {\n return composed.preEmit.reduce(function (args, preEmit) {\n var newValue = preEmit.apply(this, args);\n return newValue === undefined ? args : [newValue];\n }.bind(this), arguments);\n };\n }\n if (composed.shouldEmit.length > 1) {\n updated.shouldEmit = function () {\n var args = arguments;\n return !composed.shouldEmit.some(function (shouldEmit) {\n return !shouldEmit.apply(this, args);\n }, this);\n };\n }\n Object.keys(composed).forEach(function (composable) {\n if (composed[composable].length === 1) {\n updated[composable] = composed[composable][0];\n }\n });\n\n return updated;\n};\n",
"/*\n * isObject, extend, isFunction, isArguments are taken from undescore/lodash in\n * order to remove the dependency\n */\nvar isObject = exports.isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n};\n\nexports.extend = function(obj) {\n if (!isObject(obj)) {\n return obj;\n }\n var source, prop;\n for (var i = 1, length = arguments.length; i < length; i++) {\n source = arguments[i];\n for (prop in source) {\n if (Object.getOwnPropertyDescriptor && Object.defineProperty) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(source, prop);\n Object.defineProperty(obj, prop, propertyDescriptor);\n } else {\n obj[prop] = source[prop];\n }\n }\n }\n return obj;\n};\n\nexports.isFunction = function(value) {\n return typeof value === 'function';\n};\n\nexports.EventEmitter = require('eventemitter3');\n\nexports.nextTick = function(callback) {\n setTimeout(callback, 0);\n};\n\nexports.capitalize = function(string){\n return string.charAt(0).toUpperCase()+string.slice(1);\n};\n\nexports.callbackName = function(string){\n return \"on\"+exports.capitalize(string);\n};\n\nexports.object = function(keys,vals){\n var o={}, i=0;\n for(;i<keys.length;i++){\n o[keys[i]] = vals[i];\n }\n return o;\n};\n\nexports.Promise = require(\"native-promise-only\");\n\nexports.createPromise = function(resolver) {\n return new exports.Promise(resolver);\n};\n\nexports.isArguments = function(value) {\n return typeof value === 'object' && ('callee' in value) && typeof value.length === 'number';\n};\n\nexports.throwIf = function(val,msg){\n if (val){\n throw Error(msg||val);\n }\n};\n",
"var React=require(\"react\");\r\nrequire(\"ksana2015-webruntime/livereload\")(); \r\nvar ksanagap=require(\"ksana2015-webruntime/ksanagap\");\r\nksanagap.boot(\"z0y\",function(){\r\n\tvar Main=React.createElement(require(\"./src/main\"));\r\n\tksana.mainComponent=React.render(Main,document.getElementById(\"main\"));\r\n});",
"\r\nvar strokecount=require(\"strokecount\");\r\nvar decomposes=require(\"idsdata\").decomposes;\r\nvar getutf32 = function (opt) { // return ucs32 value from a utf 16 string, advance the string automatically\r\n\tif (!opt.widestring) return 0;\r\n\tvar s = opt.widestring;\r\n\tvar ic = s.charCodeAt(0);\r\n\tvar c = 1; // default BMP one widechar\r\n\tif (ic >= 0xd800 && ic <= 0xdcff) {\r\n\t\tvar ic2 = s.charCodeAt(1);\r\n\t\tic = 0x10000 + ((ic & 0x3ff) * 1024) + (ic2 & 0x3ff);\r\n\t\tc++; // surrogate pair\r\n\t}\r\n\topt.thechar = s.substr(0, c);\r\n\topt.widestring = s.substr(c, s.length - c);\r\n\treturn ic;\r\n};\r\n\r\nvar ucs2string = function (unicode) { //unicode ���X�� �r���A�textension B ���p\r\n if (unicode >= 0x10000 && unicode <= 0x10FFFF) {\r\n var hi = Math.floor((unicode - 0x10000) / 0x400) + 0xD800;\r\n var lo = ((unicode - 0x10000) % 0x400) + 0xDC00;\r\n return String.fromCharCode(hi) + String.fromCharCode(lo);\r\n } else {\r\n return String.fromCharCode(unicode);\r\n }\r\n};\r\nvar str2arr = function(s) {\r\n\tvar output=[];\r\n\tvar opt={widestring:s};\r\n\tvar code=0;\r\n\twhile (code=getutf32(opt)) {\r\n\t\toutput.push(code);\r\n\t}\r\n\treturn output;\r\n}\r\n\r\nvar getderived = function(part,successor ) {\r\n\tvar decompose=decomposes[0][part]; //immediate children only\r\n\tif (successor){\r\n\t\tfor (var i=1;i<decomposes.length;i++) {\r\n\t\t\tif (decomposes[i][part]) decompose+=decomposes[i][part] ;\r\n\t\t}\r\n\t}\r\n\tvar out=str2arr(decompose);\r\n\tif (successor) out.sort(function(a,b){return a-b});\r\n return out;\r\n}\r\n\r\n\r\nvar remove_once = function(arr) { // [ 1, 2, 2, 3, 3, 3 ] ==> [ 2, 3, 3]\r\n\t var prev=null;\r\n\t var output=[];\r\n\t for (var i=0;i<arr.length;i++) {\r\n\t \t if (prev===arr[i]) output.push(prev);\r\n\t \t prev=arr[i];\r\n\t }\r\n\t return output;\r\n} \r\n var array_unique = function(arr) { //must be sorted array [ 1, 2, 2, 3, 3, 3 ] ==> [ 1, 2, 3]\r\n if (!arr.length) return [];\r\n var ret = [arr[0]];\r\n for (var i = 1; i < arr.length; i++) { // start loop at 1 as element 0 can never be a duplicate\r\n if (arr[i-1] !== arr[i]) ret.push(arr[i]);\r\n }\r\n return ret;\r\n}\r\nvar array_intersect = function() { // ( [ 1,2,3] , [ 2 , 2 , 3] ) ==> [ 2 , 3]\r\n if (!arguments.length) return [];\r\n var a1 = arguments[0];\r\n var a = arguments[0];\r\n var a2 = null;\r\n var n = 1;\r\n var l,l2,jstart;\r\n while(n < arguments.length) {\r\n a = [];\r\n a2 = arguments[n];\r\n l = a1.length;\r\n l2 = a2.length;\r\n jstart=0;\r\n for(var i=0; i<l; i++) {\r\n for(var j=jstart; j<l2; j++) {\r\n if (a2[j]>a1[i]) break;\r\n if (a1[i] === a2[j]) a.push(a1[i]);\r\n \t\t}\r\n jstart=j;\r\n }\r\n a1 = a;\r\n n++;\r\n }\r\n return array_unique(a);\r\n} \r\n\r\nvar filterstroke=function(arr,totalstroke) {\r\n\tvar output=[];\r\n\tfor (var i=0;i<arr.length;i++) {\r\n\t\tif (strokecount(arr[i])==totalstroke) output.push(arr[i]);\r\n\t}\r\n\treturn output;\r\n}\r\nvar moveexta=function(res) { //move extension A after BMP\r\n\tvar output=[];\r\n\tfor (var i in res) {\r\n\t\tif (res[i]>=0x4e00 && res[i]<0x9fff) {\r\n\t\t\toutput.push(res[i]);\r\n\t\t}\r\n\t}\r\n\tfor (var i in res) {\r\n\t\tif (res[i]<0x4e00 || res[i]>=0x20000) {\r\n\t\t\toutput.push(res[i]);\r\n\t\t}\r\n\t}\r\n\treturn output;\r\n}\r\nvar gsearch=function(wh,successor) {\r\n var arg=[], derived=[];\r\n var prev=\"\",glypheme=[];\r\n var opt={widestring:wh};\r\n var numbers=wh.match(/\\d+/g);\r\n var remainstroke=0;\r\n\r\n for (var i in numbers) remainstroke+=parseInt(numbers[i]);\r\n\r\n\twhile (opt.widestring!==\"\") {\r\n\t\tvar code=getutf32(opt);\r\n\t\tif ((code>=0x3400 && code<=0x9fff) ||\r\n\t\t\t(code>=0x20000 && code<0x2ffff) ||\r\n\t\t\t(code>=0xe000 && 0xf8ff) )\r\n\t\t\tglypheme.push(opt.thechar);\r\n\t}\r\n \r\n\tif (glypheme.length==0) return [];\r\n\tif (glypheme.length==1) {\r\n\t\tvar r=getderived(glypheme[0], successor );\r\n\t\tif (remainstroke) {\r\n\t\t\tvar stroke=strokecount(glypheme[0]) + remainstroke;\r\n\t\t\treturn moveexta(filterstroke(r,stroke));\r\n\t\t}\r\n\t\treturn moveexta(r)||[];\r\n\t}\r\n\tglypheme.sort(); // 口木口木 ==> 口口木木\r\n\tvar partstroke=0;\r\n\tfor (var i=0;i<glypheme.length;i++) {\r\n\t\tpartstroke+=strokecount(glypheme[i]);\r\n\t\tif (prev===glypheme[i]) { // for searching repeated part\r\n\t\t derived=remove_once(derived);\r\n\t\t} else {\r\n\t\t derived=getderived(glypheme[i],successor );\r\n\t\t}\r\n\t\tif (derived===\"\") return [];\r\n\t\targ.push( derived );\r\n\t\tprev=glypheme[i];\r\n\t}\r\n\tvar res=array_intersect.apply(null, arg);\r\n\tif (remainstroke|| (numbers && numbers.length)) {\r\n\t\tvar stroke=partstroke + remainstroke;\r\n\t\treturn moveexta(filterstroke(res,stroke));\t \r\n\t}\r\n\treturn moveexta(res);\r\n}\r\n\r\ngsearch.getutf32=getutf32;\r\ngsearch.ucs2string=ucs2string;\r\nmodule.exports=gsearch;",
"// Reference : http://www.cam.hi-ho.ne.jp/strong_warriors/teacher/chapter0{4,5}.html\r\n\r\nfunction point(x, y){\r\n this.x = x;\r\n this.y = y;\r\n}\r\n\r\nfunction getCrossPoint(x11, y11, x12, y12, x21, y21, x22, y22){ // point\r\n var a1 = y12 - y11;\r\n var b1 = x11 - x12;\r\n var c1 = -1 * a1 * x11 - b1 * y11;\r\n var a2 = y22 - y21;\r\n var b2 = x21 - x22;\r\n var c2 = -1 * a2 * x21 - b2 * y21;\r\n \r\n var temp = b1 * a2 - b2 * a1;\r\n if(temp == 0){ // parallel\r\n return false;\r\n }\r\n return new point((c1 * b2 - c2 * b1) / temp, (a1 * c2 - a2 * c1) / temp);\r\n}\r\n\r\nfunction isCross(x11, y11, x12, y12, x21, y21, x22, y22){ // boolean\r\n var temp = getCrossPoint(x11, y11, x12, y12, x21, y21, x22, y22);\r\n if(!temp){ return false; }\r\n if(x11 < x12 && (temp.x < x11 || x12 < temp.x) ||\r\n x11 > x12 && (temp.x < x12 || x11 < temp.x) ||\r\n y11 < y12 && (temp.y < y11 || y12 < temp.y) ||\r\n y11 > y12 && (temp.y < y12 || y11 < temp.y)\r\n ){\r\n return false;\r\n }\r\n if(x21 < x22 && (temp.x < x21 || x22 < temp.x) ||\r\n x21 > x22 && (temp.x < x22 || x21 < temp.x) ||\r\n y21 < y22 && (temp.y < y21 || y22 < temp.y) ||\r\n y21 > y22 && (temp.y < y22 || y21 < temp.y)\r\n ){\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\nfunction isCrossBox(x1, y1, x2, y2, bx1, by1, bx2, by2){ // boolean\r\n if(isCross(x1, y1, x2, y2, bx1, by1, bx2, by1)){ return true; }\r\n if(isCross(x1, y1, x2, y2, bx2, by1, bx2, by2)){ return true; }\r\n if(isCross(x1, y1, x2, y2, bx1, by2, bx2, by2)){ return true; }\r\n if(isCross(x1, y1, x2, y2, bx1, by1, bx1, by2)){ return true; }\r\n return false;\r\n}\r\n\r\nfunction isCrossBoxWithOthers(strokesArray, i, bx1, by1, bx2, by2){ // boolean\r\n for(var j = 0; j < strokesArray.length; j++){\r\n if(i == j){ continue; }\r\n switch(strokesArray[j][0]){\r\n case 0:\r\n case 8:\r\n case 9:\r\n break;\r\n case 6:\r\n case 7:\r\n if(isCrossBox(strokesArray[j][7],\r\n strokesArray[j][8],\r\n strokesArray[j][9],\r\n strokesArray[j][10],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n case 2:\r\n case 12:\r\n case 3:\r\n if(isCrossBox(strokesArray[j][5],\r\n strokesArray[j][6],\r\n strokesArray[j][7],\r\n strokesArray[j][8],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n default:\r\n if(isCrossBox(strokesArray[j][3],\r\n strokesArray[j][4],\r\n strokesArray[j][5],\r\n strokesArray[j][6],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction isCrossWithOthers(strokesArray, i, bx1, by1, bx2, by2){ // boolean\r\n for(var j = 0; j < strokesArray.length; j++){\r\n if(i == j){ continue; }\r\n switch(strokesArray[j][0]){\r\n case 0:\r\n case 8:\r\n case 9:\r\n break;\r\n case 6:\r\n case 7:\r\n if(isCross(strokesArray[j][7],\r\n strokesArray[j][8],\r\n strokesArray[j][9],\r\n strokesArray[j][10],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n case 2:\r\n case 12:\r\n case 3:\r\n if(isCross(strokesArray[j][5],\r\n strokesArray[j][6],\r\n strokesArray[j][7],\r\n strokesArray[j][8],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n default:\r\n if(isCross(strokesArray[j][3],\r\n strokesArray[j][4],\r\n strokesArray[j][5],\r\n strokesArray[j][6],\r\n bx1, by1, bx2, by2)){\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n}function Buhin(number){\r\n // method\r\n function set(name, data){ // void\r\n this.hash[name] = data;\r\n }\r\n Buhin.prototype.push = set;\r\n Buhin.prototype.set = set;\r\n \r\n function search(name){ // string\r\n if(this.hash[name]){\r\n return this.hash[name];\r\n }\r\n return \"\"; // no data\r\n }\r\n Buhin.prototype.search = search;\r\n \r\n // property\r\n this.hash = {};\r\n \r\n // initialize\r\n // no operation\r\n \r\n return this;\r\n}function divide_curve(kage, x1, y1, sx1, sy1, x2, y2, curve, div_curve, off_curve){\r\n var rate = 0.5;\r\n var cut = Math.floor(curve.length * rate);\r\n var cut_rate = cut / curve.length;\r\n var tx1 = x1 + (sx1 - x1) * cut_rate;\r\n var ty1 = y1 + (sy1 - y1) * cut_rate;\r\n var tx2 = sx1 + (x2 - sx1) * cut_rate;\r\n var ty2 = sy1 + (y2 - sy1) * cut_rate;\r\n var tx3 = tx1 + (tx2 - tx1) * cut_rate;\r\n var ty3 = ty1 + (ty2 - ty1) * cut_rate;\r\n \r\n div_curve[0] = new Array();\r\n div_curve[1] = new Array();\r\n off_curve[0] = new Array(6);\r\n off_curve[1] = new Array(6);\r\n \r\n // must think about 0 : <0\r\n var i;\r\n for(i = 0; i <= cut; i++){\r\n div_curve[0].push(curve[i]);\r\n }\r\n off_curve[0][0] = x1;\r\n off_curve[0][1] = y1;\r\n off_curve[0][2] = tx1;\r\n off_curve[0][3] = ty1;\r\n off_curve[0][4] = tx3;\r\n off_curve[0][5] = ty3;\r\n \r\n for(i = cut; i < curve.length; i++){\r\n div_curve[1].push(curve[i]);\r\n }\r\n off_curve[1][0] = tx3;\r\n off_curve[1][1] = ty3;\r\n off_curve[1][2] = tx2;\r\n off_curve[1][3] = ty2;\r\n off_curve[1][4] = x2;\r\n off_curve[1][5] = y2;\r\n}\r\n\r\n// ------------------------------------------------------------------\r\nfunction find_offcurve(kage, curve, sx, sy, result){\r\n var nx1, ny1, nx2, ny2, tx, ty;\r\n var minx, miny, count, diff;\r\n var tt, t, x, y, ix, iy;\r\n var mindiff = 100000;\r\n var area = 8;\r\n var mesh = 2;\r\n // area = 10 mesh = 5 -> 281 calcs\r\n // area = 10 mesh = 4 -> 180 calcs\r\n // area = 8 mesh = 4 -> 169 calcs\r\n // area = 7.5 mesh = 3 -> 100 calcs\r\n // area = 8 mesh = 2 -> 97 calcs\r\n // area = 7 mesh = 2 -> 80 calcs\r\n \r\n nx1 = curve[0][0];\r\n ny1 = curve[0][1];\r\n nx2 = curve[curve.length - 1][0];\r\n ny2 = curve[curve.length - 1][1];\r\n \r\n for(tx = sx - area; tx < sx + area; tx += mesh){\r\n for(ty = sy - area; ty < sy + area; ty += mesh){\r\n count = 0;\r\n diff = 0;\r\n for(tt = 0; tt < curve.length; tt++){\r\n t = tt / curve.length;\r\n \r\n //calculate a dot\r\n x = ((1.0 - t) * (1.0 - t) * nx1 + 2.0 * t * (1.0 - t) * tx + t * t * nx2);\r\n y = ((1.0 - t) * (1.0 - t) * ny1 + 2.0 * t * (1.0 - t) * ty + t * t * ny2);\r\n \r\n //KATAMUKI of vector by BIBUN\r\n ix = (nx1 - 2.0 * tx + nx2) * 2.0 * t + (-2.0 * nx1 + 2.0 * tx);\r\n iy = (ny1 - 2.0 * ty + ny2) * 2.0 * t + (-2.0 * ny1 + 2.0 * ty);\r\n \r\n diff += (curve[count][0] - x) * (curve[count][0] - x) + (curve[count][1] - y) * (curve[count][1] - y);\r\n if(diff > mindiff){\r\n tt = curve.length;\r\n }\r\n count++;\r\n }\r\n if(diff < mindiff){\r\n minx = tx;\r\n miny = ty;\r\n mindiff = diff;\r\n }\r\n }\r\n }\r\n \r\n for(tx = minx - mesh + 1; tx <= minx + mesh - 1; tx += 0.5){\r\n for(ty = miny - mesh + 1; ty <= miny + mesh - 1; ty += 0.5){\r\n count = 0;\r\n diff = 0;\r\n for(tt = 0; tt < curve.length; tt++){\r\n t = tt / curve.length;\r\n \r\n //calculate a dot\r\n x = ((1.0 - t) * (1.0 - t) * nx1 + 2.0 * t * (1.0 - t) * tx + t * t * nx2);\r\n y = ((1.0 - t) * (1.0 - t) * ny1 + 2.0 * t * (1.0 - t) * ty + t * t * ny2);\r\n \r\n //KATAMUKI of vector by BIBUN\r\n ix = (nx1 - 2.0 * tx + nx2) * 2.0 * t + (-2.0 * nx1 + 2.0 * tx);\r\n iy = (ny1 - 2.0 * ty + ny2) * 2.0 * t + (-2.0 * ny1 + 2.0 * ty);\r\n \r\n diff += (curve[count][0] - x) * (curve[count][0] - x) + (curve[count][1] - y) * (curve[count][1] - y);\r\n if(diff > mindiff){\r\n tt = curve.length;\r\n }\r\n count++;\r\n }\r\n if(diff < mindiff){\r\n minx = tx;\r\n miny = ty;\r\n mindiff = diff;\r\n }\r\n }\r\n }\r\n \r\n result[0] = nx1;\r\n result[1] = ny1;\r\n result[2] = minx;\r\n result[3] = miny;\r\n result[4] = nx2;\r\n result[5] = ny2;\r\n result[6] = mindiff;\r\n}\r\n\r\n// ------------------------------------------------------------------\r\nfunction get_candidate(kage, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3, opt4){\r\n var x, y, ix, iy, ir, ia, ib, tt, t, deltad;\r\n var hosomi = 0.5;\r\n \r\n curve[0] = new Array();\r\n curve[1] = new Array();\r\n \r\n for(tt = 0; tt <= 1000; tt = tt + kage.kRate){\r\n t = tt / 1000;\r\n \r\n //calculate a dot\r\n x = ((1.0 - t) * (1.0 - t) * x1 + 2.0 * t * (1.0 - t) * sx1 + t * t * x2);\r\n y = ((1.0 - t) * (1.0 - t) * y1 + 2.0 * t * (1.0 - t) * sy1 + t * t * y2);\r\n \r\n //KATAMUKI of vector by BIBUN\r\n ix = (x1 - 2.0 * sx1 + x2) * 2.0 * t + (-2.0 * x1 + 2.0 * sx1);\r\n iy = (y1 - 2.0 * sy1 + y2) * 2.0 * t + (-2.0 * y1 + 2.0 * sy1);\r\n //line SUICHOKU by vector\r\n if(ix != 0 && iy != 0){\r\n ir = Math.atan(iy / ix * -1);\r\n ia = Math.sin(ir) * (kage.kMinWidthT);\r\n ib = Math.cos(ir) * (kage.kMinWidthT);\r\n }\r\n else if(ix == 0){\r\n ia = kage.kMinWidthT;\r\n ib = 0;\r\n }\r\n else{\r\n ia = 0;\r\n ib = kage.kMinWidthT;\r\n }\r\n \r\n if(a1 == 7 && a2 == 0){ // L2RD: fatten\r\n deltad = Math.pow(t, hosomi) * kage.kL2RDfatten;\r\n }\r\n else if(a1 == 7){\r\n deltad = Math.pow(t, hosomi);\r\n }\r\n else if(a2 == 7){\r\n deltad = Math.pow(1.0 - t, hosomi);\r\n }\r\n else if(opt3 > 0){\r\n deltad = (((kage.kMinWidthT - opt4 / 2) - opt3 / 2) / (kage.kMinWidthT - opt4 / 2)) + opt3 / 2 / (kage.kMinWidthT - opt4) * t;\r\n }\r\n else{ deltad = 1; }\r\n \r\n if(deltad < 0.15){\r\n deltad = 0.15;\r\n }\r\n ia = ia * deltad;\r\n ib = ib * deltad;\r\n \r\n //reverse if vector is going 2nd/3rd quadrants\r\n if(ix <= 0){\r\n ia = ia * -1;\r\n ib = ib * -1;\r\n }\r\n \r\n temp = new Array(2);\r\n temp[0] = x - ia;\r\n temp[1] = y - ib;\r\n curve[0].push(temp);\r\n temp = new Array(2);\r\n temp[0] = x + ia;\r\n temp[1] = y + ib;\r\n curve[1].push(temp);\r\n }\r\n}function Kage(size){\r\n // method\r\n function makeGlyph(polygons, buhin){ // void\r\n var glyphData = this.kBuhin.search(buhin);\r\n this.makeGlyph2(polygons, glyphData);\r\n }\r\n Kage.prototype.makeGlyph = makeGlyph;\r\n \r\n function makeGlyph2(polygons, data){ // void\r\n if(data != \"\"){\r\n\t var strokesArray = this.adjustKirikuchi(this.adjustUroko2(this.adjustUroko(this.adjustKakato(this.adjustTate(this.adjustMage(this.adjustHane(this.getEachStrokes(data))))))));\r\n\t for(var i = 0; i < strokesArray.length; i++){\r\n\t dfDrawFont(this, polygons,\r\n\t\t\t strokesArray[i][0],\r\n\t\t\t strokesArray[i][1],\r\n\t\t\t strokesArray[i][2],\r\n\t\t\t strokesArray[i][3],\r\n\t\t\t strokesArray[i][4],\r\n\t\t\t strokesArray[i][5],\r\n\t\t\t strokesArray[i][6],\r\n\t\t\t strokesArray[i][7],\r\n\t\t\t strokesArray[i][8],\r\n\t\t\t strokesArray[i][9],\r\n\t\t\t strokesArray[i][10]);\r\n\t }\r\n }\r\n }\r\n Kage.prototype.makeGlyph2 = makeGlyph2;\r\n \r\n function makeGlyph3(data){ // void\r\n var result = new Array();\r\n if(data != \"\"){\r\n\t var strokesArray = this.adjustKirikuchi(this.adjustUroko2(this.adjustUroko(this.adjustKakato(this.adjustTate(this.adjustMage(this.adjustHane(this.getEachStrokes(data))))))));\r\n\t for(var i = 0; i < strokesArray.length; i++){\r\n\t var polygons = new Polygons();\r\n\t dfDrawFont(this, polygons,\r\n\t\t\t strokesArray[i][0],\r\n\t\t\t strokesArray[i][1],\r\n\t\t\t strokesArray[i][2],\r\n\t\t\t strokesArray[i][3],\r\n\t\t\t strokesArray[i][4],\r\n\t\t\t strokesArray[i][5],\r\n\t\t\t strokesArray[i][6],\r\n\t\t\t strokesArray[i][7],\r\n\t\t\t strokesArray[i][8],\r\n\t\t\t strokesArray[i][9],\r\n\t\t\t strokesArray[i][10]);\r\n\t result.push(polygons);\r\n\t }\r\n }\r\n return result;\r\n }\r\n Kage.prototype.makeGlyph3 = makeGlyph3;\r\n \r\n function getEachStrokes(glyphData){ // strokes array\r\n var strokesArray = new Array();\r\n var strokes = glyphData.split(\"$\");\r\n for(var i = 0; i < strokes.length; i++){\r\n var columns = strokes[i].split(\":\");\r\n if(Math.floor(columns[0]) != 99){\r\n strokesArray.push([\r\n Math.floor(columns[0]),\r\n Math.floor(columns[1]),\r\n Math.floor(columns[2]),\r\n Math.floor(columns[3]),\r\n Math.floor(columns[4]),\r\n Math.floor(columns[5]),\r\n Math.floor(columns[6]),\r\n Math.floor(columns[7]),\r\n Math.floor(columns[8]),\r\n Math.floor(columns[9]),\r\n Math.floor(columns[10])\r\n ]);\r\n } else {\r\n var buhin = this.kBuhin.search(columns[7]);\r\n if(buhin != \"\"){\r\n strokesArray = strokesArray.concat(this.getEachStrokesOfBuhin(buhin,\r\n Math.floor(columns[3]),\r\n Math.floor(columns[4]),\r\n Math.floor(columns[5]),\r\n Math.floor(columns[6]),\r\n Math.floor(columns[1]),\r\n Math.floor(columns[2]),\r\n Math.floor(columns[9]),\r\n Math.floor(columns[10]))\r\n );\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.getEachStrokes = getEachStrokes;\r\n \r\n function getEachStrokesOfBuhin(buhin, x1, y1, x2, y2, sx, sy, sx2, sy2){\r\n var temp = this.getEachStrokes(buhin);\r\n var result = new Array();\r\n var box = this.getBox(buhin);\r\n if(sx != 0 || sy != 0){\r\n\t if(sx > 100){\r\n\t sx -= 200; // Ǥ°ÕÅÀ¥â¡¼¥É\r\n\t } else {\r\n\t sx2 = 0; // Ãæ¿´ÅÀ¥â¡¼¥É\r\n\t sy2 = 0;\r\n\t }\r\n }\r\n for(var i = 0; i < temp.length; i++){\r\n\tif(sx != 0 || sy != 0){\r\n\t temp[i][3] = stretch(sx, sx2, temp[i][3], box.minX, box.maxX);\r\n\t temp[i][4] = stretch(sy, sy2, temp[i][4], box.minY, box.maxY);\r\n\t temp[i][5] = stretch(sx, sx2, temp[i][5], box.minX, box.maxX);\r\n\t temp[i][6] = stretch(sy, sy2,temp[i][6], box.minY, box.maxY);\r\n\t if(temp[i][0] != 99){\r\n\t\ttemp[i][7] = stretch(sx, sx2, temp[i][7], box.minX, box.maxX);\t\r\n\t\ttemp[i][8] = stretch(sy, sy2, temp[i][8], box.minY, box.maxY);\r\n\t\ttemp[i][9] = stretch(sx, sx2, temp[i][9], box.minX, box.maxX);\r\n\t\ttemp[i][10] = stretch(sy, sy2, temp[i][10], box.minY, box.maxY);\r\n\t }\r\n\t}\r\n result.push([temp[i][0],\r\n temp[i][1],\r\n temp[i][2],\r\n x1 + temp[i][3] * (x2 - x1) / 200,\r\n y1 + temp[i][4] * (y2 - y1) / 200,\r\n x1 + temp[i][5] * (x2 - x1) / 200,\r\n y1 + temp[i][6] * (y2 - y1) / 200,\r\n x1 + temp[i][7] * (x2 - x1) / 200,\r\n y1 + temp[i][8] * (y2 - y1) / 200,\r\n x1 + temp[i][9] * (x2 - x1) / 200,\r\n y1 + temp[i][10] * (y2 - y1) / 200]);\r\n }\r\n return result;\r\n }\r\n Kage.prototype.getEachStrokesOfBuhin = getEachStrokesOfBuhin;\r\n \r\n function adjustHane(sa){ // strokesArray\r\n for(var i = 0; i < sa.length; i++){\r\n\t if((sa[i][0] == 1 || sa[i][0] == 2 || sa[i][0] == 6) && sa[i][2] == 4){\r\n\t var lpx; // lastPointX\r\n\t var lpy; // lastPointY\r\n\t if(sa[i][0] == 1){\r\n\t\t lpx = sa[i][5];\r\n\t\t lpy = sa[i][6];\r\n\t } else if(sa[i][0] == 2){\r\n\t\t lpx = sa[i][7];\r\n\t\t lpy = sa[i][8];\r\n\t } else {\r\n\t\t lpx = sa[i][9];\r\n\t\t lpy = sa[i][10];\r\n\t }\r\n\t var mn = Infinity; // mostNear\r\n\t if(lpx + 18 < 100){\r\n\t\t mn = lpx + 18;\r\n\t }\r\n\t for(var j = 0; j < sa.length; j++){\r\n\t\t if(i != j && sa[j][0] == 1 && sa[j][3] == sa[j][5] && sa[j][3] < lpx && sa[j][4] <= lpy && sa[j][6] >= lpy){\r\n\t\t if(lpx - sa[j][3] < 100){\r\n\t\t\t mn = Math.min(mn, lpx - sa[j][3]);\r\n\t\t }\r\n\t\t }\r\n\t }\r\n\t if(mn != Infinity){\r\n\t\t sa[i][2] += 700 - Math.floor(mn / 15) * 100; // 0-99 -> 0-700\r\n\t }\r\n\t }\r\n }\r\n return sa;\r\n }\r\n Kage.prototype.adjustHane = adjustHane;\r\n\r\n function adjustUroko(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if(strokesArray[i][0] == 1 && strokesArray[i][2] == 0){ // no operation for TATE\r\n for(var k = 0; k < this.kAdjustUrokoLengthStep; k++){\r\n var tx, ty, tlen;\r\n if(strokesArray[i][4] == strokesArray[i][6]){ // YOKO\r\n tx = strokesArray[i][5] - this.kAdjustUrokoLine[k];\r\n ty = strokesArray[i][6] - 0.5;\r\n tlen = strokesArray[i][5] - strokesArray[i][3];\r\n } else {\r\n var rad = Math.atan((strokesArray[i][6] - strokesArray[i][4]) / (strokesArray[i][5] - strokesArray[i][3]));\r\n tx = strokesArray[i][5] - this.kAdjustUrokoLine[k] * Math.cos(rad) - 0.5 * Math.sin(rad);\r\n ty = strokesArray[i][6] - this.kAdjustUrokoLine[k] * Math.sin(rad) - 0.5 * Math.cos(rad);\r\n tlen = Math.sqrt((strokesArray[i][6] - strokesArray[i][4]) * (strokesArray[i][6] - strokesArray[i][4]) +\r\n (strokesArray[i][5] - strokesArray[i][3]) * (strokesArray[i][5] - strokesArray[i][3]));\r\n }\r\n if(tlen < this.kAdjustUrokoLength[k] ||\r\n isCrossWithOthers(strokesArray, i, tx, ty, strokesArray[i][5], strokesArray[i][6])\r\n ){\r\n strokesArray[i][2] += (this.kAdjustUrokoLengthStep - k) * 100;\r\n k = Infinity;\r\n }\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustUroko = adjustUroko;\r\n \r\n function adjustUroko2(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if(strokesArray[i][0] == 1 && strokesArray[i][2] == 0 && strokesArray[i][4] == strokesArray[i][6]){\r\n var pressure = 0;\r\n for(var j = 0; j < strokesArray.length; j++){\r\n if(i != j && (\r\n (strokesArray[j][0] == 1 && strokesArray[j][4] == strokesArray[j][6] &&\r\n !(strokesArray[i][3] + 1 > strokesArray[j][5] || strokesArray[i][5] - 1 < strokesArray[j][3]) &&\r\n Math.abs(strokesArray[i][4] - strokesArray[j][4]) < this.kAdjustUroko2Length) ||\r\n (strokesArray[j][0] == 3 && strokesArray[j][6] == strokesArray[j][8] &&\r\n !(strokesArray[i][3] + 1 > strokesArray[j][7] || strokesArray[i][5] - 1 < strokesArray[j][5]) &&\r\n Math.abs(strokesArray[i][4] - strokesArray[j][6]) < this.kAdjustUroko2Length)\r\n )){\r\n pressure += Math.pow(this.kAdjustUroko2Length - Math.abs(strokesArray[i][4] - strokesArray[j][6]), 1.1);\r\n }\r\n }\r\n var result = Math.min(Math.floor(pressure / this.kAdjustUroko2Length), this.kAdjustUroko2Step) * 100;\r\n if(strokesArray[i][2] < result){\r\n strokesArray[i][2] = strokesArray[i][2] % 100 + Math.min(Math.floor(pressure / this.kAdjustUroko2Length), this.kAdjustUroko2Step) * 100;\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustUroko2 = adjustUroko2;\r\n \r\n function adjustTate(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if((strokesArray[i][0] == 1 || strokesArray[i][0] == 3 || strokesArray[i][0] == 7) && strokesArray[i][3] == strokesArray[i][5]){\r\n for(var j = 0; j < strokesArray.length; j++){\r\n if(i != j && (strokesArray[j][0] == 1 || strokesArray[j][0] == 3 || strokesArray[j][0] == 7) && strokesArray[j][3] == strokesArray[j][5] &&\r\n !(strokesArray[i][4] + 1 > strokesArray[j][6] || strokesArray[i][6] - 1 < strokesArray[j][4]) &&\r\n Math.abs(strokesArray[i][3] - strokesArray[j][3]) < this.kMinWidthT * this.kAdjustTateStep){\r\n strokesArray[i][1] += (this.kAdjustTateStep - Math.floor(Math.abs(strokesArray[i][3] - strokesArray[j][3]) / this.kMinWidthT)) * 1000;\r\n if(strokesArray[i][1] > this.kAdjustTateStep * 1000){\r\n strokesArray[i][1] = strokesArray[i][1] % 1000 + this.kAdjustTateStep * 1000;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustTate = adjustTate;\r\n \r\n function adjustMage(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if((strokesArray[i][0] == 3) && strokesArray[i][6] == strokesArray[i][8]){\r\n for(var j = 0; j < strokesArray.length; j++){\r\n if(i != j && (\r\n (strokesArray[j][0] == 1 && strokesArray[j][4] == strokesArray[j][6] &&\r\n !(strokesArray[i][5] + 1 > strokesArray[j][5] || strokesArray[i][7] - 1 < strokesArray[j][3]) &&\r\n Math.abs(strokesArray[i][6] - strokesArray[j][4]) < this.kMinWidthT * this.kAdjustMageStep) ||\r\n (strokesArray[j][0] == 3 && strokesArray[j][6] == strokesArray[j][8] &&\r\n !(strokesArray[i][5] + 1 > strokesArray[j][7] || strokesArray[i][7] - 1 < strokesArray[j][5]) &&\r\n Math.abs(strokesArray[i][6] - strokesArray[j][6]) < this.kMinWidthT * this.kAdjustMageStep)\r\n )){\r\n strokesArray[i][2] += (this.kAdjustMageStep - Math.floor(Math.abs(strokesArray[i][6] - strokesArray[j][6]) / this.kMinWidthT)) * 1000;\r\n if(strokesArray[i][2] > this.kAdjustMageStep * 1000){\r\n strokesArray[i][2] = strokesArray[i][2] % 1000 + this.kAdjustMageStep * 1000;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustMage = adjustMage;\r\n \r\n function adjustKirikuchi(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if(strokesArray[i][0] == 2 && strokesArray[i][1] == 32 &&\r\n strokesArray[i][3] > strokesArray[i][5] &&\r\n strokesArray[i][4] < strokesArray[i][6]){\r\n for(var j = 0; j < strokesArray.length; j++){ // no need to skip when i == j\r\n if(strokesArray[j][0] == 1 &&\r\n strokesArray[j][3] < strokesArray[i][3] && strokesArray[j][5] > strokesArray[i][3] &&\r\n strokesArray[j][4] == strokesArray[i][4] && strokesArray[j][4] == strokesArray[j][6]){\r\n strokesArray[i][1] = 132;\r\n j = strokesArray.length;\r\n }\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustKirikuchi = adjustKirikuchi;\r\n \r\n function adjustKakato(strokesArray){ // strokesArray\r\n for(var i = 0; i < strokesArray.length; i++){\r\n if(strokesArray[i][0] == 1 &&\r\n (strokesArray[i][2] == 13 || strokesArray[i][2] == 23)){\r\n for(var k = 0; k < this.kAdjustKakatoStep; k++){\r\n if(isCrossBoxWithOthers(strokesArray, i,\r\n strokesArray[i][5] - this.kAdjustKakatoRangeX / 2,\r\n strokesArray[i][6] + this.kAdjustKakatoRangeY[k],\r\n strokesArray[i][5] + this.kAdjustKakatoRangeX / 2,\r\n strokesArray[i][6] + this.kAdjustKakatoRangeY[k + 1])\r\n | strokesArray[i][6] + this.kAdjustKakatoRangeY[k + 1] > 200 // adjust for baseline\r\n | strokesArray[i][6] - strokesArray[i][4] < this.kAdjustKakatoRangeY[k + 1] // for thin box\r\n ){\r\n strokesArray[i][2] += (3 - k) * 100;\r\n k = Infinity;\r\n }\r\n }\r\n }\r\n }\r\n return strokesArray;\r\n }\r\n Kage.prototype.adjustKakato = adjustKakato;\r\n \r\n function getBox(glyph){ // minX, minY, maxX, maxY\r\n var a = new Object();\r\n a.minX = 200;\r\n a.minY = 200;\r\n a.maxX = 0;\r\n a.maxY = 0;\r\n \r\n var strokes = this.getEachStrokes(glyph);\r\n for(var i = 0; i < strokes.length; i++){\r\n\t if(strokes[i][0] == 0){ continue; }\r\n\t a.minX = Math.min(a.minX, strokes[i][3]);\r\n\t a.maxX = Math.max(a.maxX, strokes[i][3]);\r\n\t a.minY = Math.min(a.minY, strokes[i][4]);\r\n\t a.maxY = Math.max(a.maxY, strokes[i][4]);\r\n\t a.minX = Math.min(a.minX, strokes[i][5]);\r\n\t a.maxX = Math.max(a.maxX, strokes[i][5]);\r\n\t a.minY = Math.min(a.minY, strokes[i][6]);\r\n\t a.maxY = Math.max(a.maxY, strokes[i][6]);\r\n\t if(strokes[i][0] == 1){ continue; }\r\n\t if(strokes[i][0] == 99){ continue; }\r\n\t a.minX = Math.min(a.minX, strokes[i][7]);\r\n\t a.maxX = Math.max(a.maxX, strokes[i][7]);\r\n\t a.minY = Math.min(a.minY, strokes[i][8]);\r\n\t a.maxY = Math.max(a.maxY, strokes[i][8]);\r\n\t if(strokes[i][0] == 2){ continue; }\r\n\t if(strokes[i][0] == 3){ continue; }\r\n\t if(strokes[i][0] == 4){ continue; }\r\n\t a.minX = Math.min(a.minX, strokes[i][9]);\r\n\t a.maxX = Math.max(a.maxX, strokes[i][9]);\r\n\t a.minY = Math.min(a.minY, strokes[i][10]);\r\n\t a.maxY = Math.max(a.maxY, strokes[i][10]);\r\n }\r\n return a;\r\n }\r\n Kage.prototype.getBox = getBox;\r\n\r\n function stretch(dp, sp, p, min, max){ // interger\r\n var p1, p2, p3, p4;\r\n if(p < sp + 100){\r\n\t p1 = min;\r\n\t p3 = min;\r\n\t p2 = sp + 100;\r\n\t p4 = dp + 100;\r\n } else {\r\n\t p1 = sp + 100;\r\n\t p3 = dp + 100;\r\n\t p2 = max;\r\n\t p4 = max;\r\n }\r\n return Math.floor(((p - p1) / (p2 - p1)) * (p4 - p3) + p3);\r\n }\r\n Kage.prototype.stretch = stretch;\r\n\r\n //properties\r\n Kage.prototype.kMincho = 0;\r\n Kage.prototype.kGothic = 1;\r\n this.kShotai = this.kMincho;\r\n \r\n this.kRate = 100;\r\n \r\n if(size == 1){\r\n this.kMinWidthY = 1.2;\r\n this.kMinWidthT = 3.6;\r\n this.kWidth = 3;\r\n this.kKakato = 1.8;\r\n this.kL2RDfatten = 1.1;\r\n this.kMage = 6;\r\n this.kUseCurve = 0;\r\n \r\n this.kAdjustKakatoL = ([8, 5, 3, 1]); // for KAKATO adjustment 000,100,200,300\r\n this.kAdjustKakatoR = ([4, 3, 2, 1]); // for KAKATO adjustment 000,100,200,300\r\n this.kAdjustKakatoRangeX = 12; // check area width\r\n this.kAdjustKakatoRangeY = ([1, 11, 14, 18]); // 3 steps of checking\r\n this.kAdjustKakatoStep = 3; // number of steps\r\n \r\n this.kAdjustUrokoX = ([14, 12, 9, 7]); // for UROKO adjustment 000,100,200,300\r\n this.kAdjustUrokoY = ([7, 6, 5, 4]); // for UROKO adjustment 000,100,200,300\r\n this.kAdjustUrokoLength = ([13, 21, 30]); // length for checking\r\n this.kAdjustUrokoLengthStep = 3; // number of steps\r\n this.kAdjustUrokoLine = ([13, 15, 18]); // check for crossing. corresponds to length\r\n } else {\r\n this.kMinWidthY = 2;\r\n this.kMinWidthT = 6;\r\n this.kWidth = 5;\r\n this.kKakato = 3;\r\n this.kL2RDfatten = 1.1;\r\n this.kMage = 10;\r\n this.kUseCurve = 0;\r\n \r\n this.kAdjustKakatoL = ([14, 9, 5, 2]); // for KAKATO adjustment 000,100,200,300\r\n this.kAdjustKakatoR = ([8, 6, 4, 2]); // for KAKATO adjustment 000,100,200,300\r\n this.kAdjustKakatoRangeX = 20; // check area width\r\n this.kAdjustKakatoRangeY = ([1, 19, 24, 30]); // 3 steps of checking\r\n this.kAdjustKakatoStep = 3; // number of steps\r\n \r\n this.kAdjustUrokoX = ([24, 20, 16, 12]); // for UROKO adjustment 000,100,200,300\r\n this.kAdjustUrokoY = ([12, 11, 9, 8]); // for UROKO adjustment 000,100,200,300\r\n this.kAdjustUrokoLength = ([22, 36, 50]); // length for checking\r\n this.kAdjustUrokoLengthStep = 3; // number of steps\r\n this.kAdjustUrokoLine = ([22, 26, 30]); // check for crossing. corresponds to length\r\n \r\n this.kAdjustUroko2Step = 3;\r\n this.kAdjustUroko2Length = 40;\r\n \r\n this.kAdjustTateStep = 4;\r\n \r\n this.kAdjustMageStep = 5;\r\n }\r\n \r\n this.kBuhin = new Buhin();\r\n \r\n return this;\r\n}\r\nfunction cdDrawCurveU(kage, polygons, x1, y1, sx1, sy1, sx2, sy2, x2, y2, ta1, ta2){\r\n var rad, t;\r\n var x, y, v;\r\n var ix, iy, ia, ib, ir;\r\n var tt;\r\n var delta;\r\n var deltad;\r\n var XX, XY, YX, YY;\r\n var poly, poly2;\r\n var hosomi;\r\n var kMinWidthT, kMinWidthT2;\r\n var a1, a2, opt1, opt2, opt3, opt4;\r\n \r\n if(kage.kShotai == kage.kMincho){ // mincho\r\n a1 = ta1 % 1000;\r\n a2 = ta2 % 100;\r\n opt1 = Math.floor((ta1 % 10000) / 1000);\r\n opt2 = Math.floor((ta2 % 1000) / 100);\r\n opt3 = Math.floor(ta1 / 10000);\r\n opt4 = Math.floor(ta2 / 1000);\r\n \r\n kMinWidthT = kage.kMinWidthT - opt1 / 2;\r\n kMinWidthT2 = kage.kMinWidthT - opt4 / 2;\r\n \r\n switch(a1 % 100){\r\n case 0:\r\n case 7:\r\n delta = -1 * kage.kMinWidthY * 0.5;\r\n break;\r\n case 1:\r\n case 2: // ... must be 32\r\n case 6:\r\n case 22:\r\n case 32: // changed\r\n delta = 0;\r\n break;\r\n case 12:\r\n //case 32:\r\n delta = kage.kMinWidthY;\r\n break;\r\n default:\r\n break;\r\n }\r\n \r\n if(x1 == sx1){\r\n if(y1 < sy1){ y1 = y1 - delta; }\r\n else{ y1 = y1 + delta; }\r\n }\r\n else if(y1 == sy1){\r\n if(x1 < sx1){ x1 = x1 - delta; }\r\n else{ x1 = x1 + delta; }\r\n }\r\n else{\r\n rad = Math.atan((sy1 - y1) / (sx1 - x1));\r\n if(x1 < sx1){ v = 1; } else{ v = -1; }\r\n x1 = x1 - delta * Math.cos(rad) * v;\r\n y1 = y1 - delta * Math.sin(rad) * v;\r\n }\r\n \r\n switch(a2 % 100){\r\n case 0:\r\n case 1:\r\n case 7:\r\n case 9:\r\n case 15: // it can change to 15->5\r\n case 14: // it can change to 14->4\r\n case 17: // no need\r\n case 5:\r\n delta = 0;\r\n break;\r\n case 8: // get shorten for tail's circle\r\n delta = -1 * kMinWidthT * 0.5;\r\n break;\r\n default:\r\n break;\r\n }\r\n \r\n if(sx2 == x2){\r\n if(sy2 < y2){ y2 = y2 + delta; }\r\n else{ y2 = y2 - delta; }\r\n }\r\n else if(sy2 == y2){\r\n if(sx2 < x2){ x2 = x2 + delta; }\r\n else{ x2 = x2 - delta; }\r\n }\r\n else{\r\n rad = Math.atan((y2 - sy2) / (x2 - sx2));\r\n if(sx2 < x2){ v = 1; } else{ v = -1; }\r\n x2 = x2 + delta * Math.cos(rad) * v;\r\n y2 = y2 + delta * Math.sin(rad) * v;\r\n }\r\n \r\n hosomi = 0.5;\r\n if(Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) < 50){\r\n hosomi += 0.4 * (1 - Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) / 50);\r\n }\r\n \r\n //---------------------------------------------------------------\r\n \r\n poly = new Polygon();\r\n poly2 = new Polygon();\r\n \r\n if(sx1 == sx2 && sy1 == sy2){ // Spline\r\n if(kage.kUseCurve){\r\n // generating fatten curve -- begin\r\n var kage2 = new Kage();\r\n kage2.kMinWidthY = kage.kMinWidthY;\r\n kage2.kMinWidthT = kMinWidthT;\r\n kage2.kWidth = kage.kWidth;\r\n kage2.kKakato = kage.kKakato;\r\n kage2.kRate = 10;\r\n \r\n var curve = new Array(2); // L and R\r\n get_candidate(kage2, curve, a1, a2, x1, y1, sx1, sy1, x2, y2, opt3, opt4);\r\n \r\n var dcl12_34 = new Array(2);\r\n var dcr12_34 = new Array(2);\r\n var dpl12_34 = new Array(2);\r\n var dpr12_34 = new Array(2);\r\n divide_curve(kage2, x1, y1, sx1, sy1, x2, y2, curve[0], dcl12_34, dpl12_34);\r\n divide_curve(kage2, x1, y1, sx1, sy1, x2, y2, curve[1], dcr12_34, dpr12_34);\r\n \r\n var ncl1 = new Array(7);\r\n var ncl2 = new Array(7);\r\n find_offcurve(kage2, dcl12_34[0], dpl12_34[0][2], dpl12_34[0][3], ncl1);\r\n find_offcurve(kage2, dcl12_34[1], dpl12_34[1][2], dpl12_34[1][3], ncl2);\r\n \r\n poly.push(ncl1[0], ncl1[1]);\r\n poly.push(ncl1[2], ncl1[3], 1);\r\n poly.push(ncl1[4], ncl1[5]);\r\n poly.push(ncl2[2], ncl2[3], 1);\r\n poly.push(ncl2[4], ncl2[5]);\r\n \r\n poly2.push(dcr12_34[0][0][0], dcr12_34[0][0][1]);\r\n poly2.push(dpr12_34[0][2] - (ncl1[2] - dpl12_34[0][2]), dpl12_34[0][3] - (ncl1[3] - dpl12_34[0][3]), 1);\r\n poly2.push(dcr12_34[0][dcr12_34[0].length - 1][0], dcr12_34[0][dcr12_34[0].length - 1][1]);\r\n poly2.push(dpr12_34[1][2] - (ncl2[2] - dpl12_34[1][2]), dpl12_34[1][3] - (ncl2[3] - dpl12_34[1][3]), 1);\r\n poly2.push(dcr12_34[1][dcr12_34[1].length - 1][0], dcr12_34[1][dcr12_34[1].length - 1][1]);\r\n \r\n poly2.reverse();\r\n poly.concat(poly2);\r\n polygons.push(poly);\r\n // generating fatten curve -- end\r\n } else {\r\n for(tt = 0; tt <= 1000; tt = tt + kage.kRate){\r\n t = tt / 1000;\r\n \r\n // calculate a dot\r\n x = ((1.0 - t) * (1.0 - t) * x1 + 2.0 * t * (1.0 - t) * sx1 + t * t * x2);\r\n y = ((1.0 - t) * (1.0 - t) * y1 + 2.0 * t * (1.0 - t) * sy1 + t * t * y2);\r\n \r\n // KATAMUKI of vector by BIBUN\r\n ix = (x1 - 2.0 * sx1 + x2) * 2.0 * t + (-2.0 * x1 + 2.0 * sx1);\r\n iy = (y1 - 2.0 * sy1 + y2) * 2.0 * t + (-2.0 * y1 + 2.0 * sy1);\r\n \r\n // line SUICHOKU by vector\r\n if(ix != 0 && iy != 0){\r\n ir = Math.atan(iy / ix * -1);\r\n ia = Math.sin(ir) * (kMinWidthT);\r\n ib = Math.cos(ir) * (kMinWidthT);\r\n }\r\n else if(ix == 0){\r\n ia = kMinWidthT;\r\n ib = 0;\r\n }\r\n else{\r\n ia = 0;\r\n ib = kMinWidthT;\r\n }\r\n \r\n if(a1 == 7 && a2 == 0){ // L2RD: fatten\r\n deltad = Math.pow(t, hosomi) * kage.kL2RDfatten;\r\n }\r\n else if(a1 == 7){\r\n deltad = Math.pow(t, hosomi);\r\n }\r\n else if(a2 == 7){\r\n deltad = Math.pow(1.0 - t, hosomi);\r\n }\r\n else if(opt3 > 0 || opt4 > 0){\r\n deltad = ((kage.kMinWidthT - opt3 / 2) - (opt4 - opt3) / 2 * t) / kage.kMinWidthT;\r\n }\r\n else{ deltad = 1; }\r\n \r\n if(deltad < 0.15){\r\n deltad = 0.15;\r\n }\r\n ia = ia * deltad;\r\n ib = ib * deltad;\r\n \r\n //reverse if vector is going 2nd/3rd quadrants\r\n if(ix <= 0){\r\n ia = ia * -1;\r\n ib = ib * -1;\r\n }\r\n \r\n //copy to polygon structure\r\n poly.push(x - ia, y - ib);\r\n poly2.push(x + ia, y + ib);\r\n }\r\n \r\n // suiheisen ni setsuzoku\r\n if(a1 == 132){\r\n var index = 0;\r\n while(true){\r\n if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r\n break;\r\n }\r\n index++;\r\n }\r\n newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r\n (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r\n newy1 = y1;\r\n newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x) * (poly.array[0].y - y1) /\r\n (poly.array[1].y - poly.array[0].y);\r\n newy2 = y1;\r\n \r\n for(var i = 0; i < index; i++){\r\n poly2.shift();\r\n }\r\n poly2.set(0, newx1, newy1);\r\n poly.unshift(newx2, newy2);\r\n }\r\n \r\n // suiheisen ni setsuzoku 2\r\n if(a1 == 22 && y1 > y2){\r\n var index = 0;\r\n while(true){\r\n if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r\n break;\r\n }\r\n index++;\r\n }\r\n newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r\n (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r\n newy1 = y1;\r\n newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x - 1) * (poly.array[0].y - y1) /\r\n (poly.array[1].y - poly.array[0].y);\r\n newy2 = y1 + 1;\r\n \r\n for(var i = 0; i < index; i++){\r\n poly2.shift();\r\n }\r\n poly2.set(0, newx1, newy1);\r\n poly.unshift(newx2, newy2);\r\n }\r\n \r\n poly2.reverse();\r\n poly.concat(poly2);\r\n polygons.push(poly);\r\n }\r\n } else { // Bezier\r\n for(tt = 0; tt <= 1000; tt = tt + kage.kRate){\r\n t = tt / 1000;\r\n \r\n // calculate a dot\r\n x = (1.0 - t) * (1.0 - t) * (1.0 - t) * x1 + 3.0 * t * (1.0 - t) * (1.0 - t) * sx1 + 3 * t * t * (1.0 - t) * sx2 + t * t * t * x2;\r\n y = (1.0 - t) * (1.0 - t) * (1.0 - t) * y1 + 3.0 * t * (1.0 - t) * (1.0 - t) * sy1 + 3 * t * t * (1.0 - t) * sy2 + t * t * t * y2;\r\n // KATAMUKI of vector by BIBUN\r\n ix = t * t * (-3 * x1 + 9 * sx1 + -9 * sx2 + 3 * x2) + t * (6 * x1 + -12 * sx1 + 6 * sx2) + -3 * x1 + 3 * sx1;\r\n iy = t * t * (-3 * y1 + 9 * sy1 + -9 * sy2 + 3 * y2) + t * (6 * y1 + -12 * sy1 + 6 * sy2) + -3 * y1 + 3 * sy1;\r\n \r\n // line SUICHOKU by vector\r\n if(ix != 0 && iy != 0){\r\n ir = Math.atan(iy / ix * -1);\r\n ia = Math.sin(ir) * (kMinWidthT);\r\n ib = Math.cos(ir) * (kMinWidthT);\r\n }\r\n else if(ix == 0){\r\n ia = kMinWidthT;\r\n ib = 0;\r\n }\r\n else{\r\n ia = 0;\r\n ib = kMinWidthT;\r\n }\r\n \r\n if(a1 == 7 && a2 == 0){ // L2RD: fatten\r\n deltad = Math.pow(t, hosomi) * kage.kL2RDfatten;\r\n }\r\n else if(a1 == 7){\r\n deltad = Math.pow(t, hosomi);\r\n deltad = Math.pow(deltad, 0.7); // make fatten\r\n }\r\n else if(a2 == 7){\r\n deltad = Math.pow(1.0 - t, hosomi);\r\n }\r\n else{ deltad = 1; }\r\n \r\n if(deltad < 0.15){\r\n deltad = 0.15;\r\n }\r\n ia = ia * deltad;\r\n ib = ib * deltad;\r\n \r\n //reverse if vector is going 2nd/3rd quadrants\r\n if(ix <= 0){\r\n ia = ia * -1;\r\n ib = ib * -1;\r\n }\r\n \r\n //copy to polygon structure\r\n poly.push(x - ia, y - ib);\r\n poly2.push(x + ia, y + ib);\r\n }\r\n \r\n // suiheisen ni setsuzoku\r\n if(a1 == 132){\r\n var index = 0;\r\n while(true){\r\n if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r\n break;\r\n }\r\n index++;\r\n }\r\n newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r\n (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r\n newy1 = y1;\r\n newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x) * (poly.array[0].y - y1) /\r\n (poly.array[1].y - poly.array[0].y);\r\n newy2 = y1;\r\n \r\n for(var i = 0; i < index; i++){\r\n poly2.shift();\r\n }\r\n poly2.set(0, newx1, newy1);\r\n poly.unshift(newx2, newy2);\r\n }\r\n \r\n // suiheisen ni setsuzoku 2\r\n if(a1 == 22){\r\n var index = 0;\r\n while(true){\r\n if(poly2.array[index].y <= y1 && y1 <= poly2.array[index + 1].y){\r\n break;\r\n }\r\n index++;\r\n }\r\n newx1 = poly2.array[index + 1].x + (poly2.array[index].x - poly2.array[index + 1].x) *\r\n (poly2.array[index + 1].y - y1) / (poly2.array[index + 1].y - poly2.array[index].y);\r\n newy1 = y1;\r\n newx2 = poly.array[0].x + (poly.array[0].x - poly.array[1].x - 1) * (poly.array[0].y - y1) /\r\n (poly.array[1].y - poly.array[0].y);\r\n newy2 = y1 + 1;\r\n \r\n for(var i = 0; i < index; i++){\r\n poly2.shift();\r\n }\r\n poly2.set(0, newx1, newy1);\r\n poly.unshift(newx2, newy2);\r\n }\r\n \r\n poly2.reverse();\r\n poly.concat(poly2);\r\n polygons.push(poly);\r\n }\r\n \r\n //process for head of stroke\r\n rad = Math.atan((sy1 - y1) / (sx1 - x1));\r\n if(x1 < sx1){ v = 1; } else{ v = -1; }\r\n XX = Math.sin(rad) * v;\r\n XY = Math.cos(rad) * v * -1;\r\n YX = Math.cos(rad) * v;\r\n YY = Math.sin(rad) * v;\r\n \r\n if(a1 == 12){\r\n if(x1 == x2){\r\n poly= new Polygon();\r\n poly.push(x1 - kMinWidthT, y1);\r\n poly.push(x1 + kMinWidthT, y1);\r\n poly.push(x1 - kMinWidthT, y1 - kMinWidthT);\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r\n poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r\n poly.push(x1 - kMinWidthT * XX - kMinWidthT * YX, y1 - kMinWidthT * XY - kMinWidthT * YY);\r\n polygons.push(poly);\r\n }\r\n }\r\n \r\n var type;\r\n var pm = 0;\r\n if(a1 == 0){\r\n if(y1 <= y2){ //from up to bottom\r\n type = (Math.atan2(Math.abs(y1 - sy1), Math.abs(x1 - sx1)) / Math.PI * 2 - 0.4);\r\n if(type > 0){\r\n type = type * 2;\r\n } else {\r\n type = type * 16;\r\n }\r\n if(type < 0){\r\n pm = -1;\r\n } else {\r\n pm = 1;\r\n }\r\n if(x1 == sx1){\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1 + 1);\r\n poly.push(x1 + kMinWidthT, y1);\r\n poly.push(x1 - kMinWidthT * pm, y1 - kage.kMinWidthY * type * pm);\r\n //if(x1 > x2){\r\n // poly.reverse();\r\n //}\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT * XX + 1 * YX, y1 - kMinWidthT * XY + 1 * YY);\r\n poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r\n poly.push(x1 - kMinWidthT * pm * XX - kage.kMinWidthY * type * pm * YX, y1 - kMinWidthT * pm * XY - kage.kMinWidthY * type * pm * YY);\r\n //if(x1 > x2){\r\n // poly.reverse();\r\n //}\r\n polygons.push(poly);\r\n }\r\n }\r\n else{ //bottom to up\r\n if(x1 == sx1){\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1);\r\n poly.push(x1 + kMinWidthT, y1);\r\n poly.push(x1 + kMinWidthT, y1 - kage.kMinWidthY);\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r\n poly.push(x1 + kMinWidthT * XX, y1 + kMinWidthT * XY);\r\n poly.push(x1 + kMinWidthT * XX - kage.kMinWidthY * YX, y1 + kMinWidthT * XY - kage.kMinWidthY * YY);\r\n //if(x1 < x2){\r\n // poly.reverse();\r\n //}\r\n polygons.push(poly);\r\n }\r\n }\r\n }\r\n \r\n if(a1 == 22){ //box's up-right corner, any time same degree\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r\n poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r\n poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r\n poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1);\r\n poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4);\r\n polygons.push(poly);\r\n }\r\n \r\n if(a1 == 0){ //beginning of the stroke\r\n if(y1 <= y2){ //from up to bottom\r\n if(pm > 0){\r\n type = 0;\r\n }\r\n var move = kage.kMinWidthY * type * pm;\r\n if(x1 == sx1){\r\n poly = new Polygon();\r\n poly.push(x1 + kMinWidthT, y1 - move);\r\n poly.push(x1 + kMinWidthT * 1.5, y1 + kage.kMinWidthY - move);\r\n poly.push(x1 + kMinWidthT - 2, y1 + kage.kMinWidthY * 2 + 1);\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x1 + kMinWidthT * XX - move * YX,\r\n y1 + kMinWidthT * XY - move * YY);\r\n poly.push(x1 + kMinWidthT * 1.5 * XX + (kage.kMinWidthY - move * 1.2) * YX,\r\n y1 + kMinWidthT * 1.5 * XY + (kage.kMinWidthY - move * 1.2) * YY);\r\n poly.push(x1 + (kMinWidthT - 2) * XX + (kage.kMinWidthY * 2 - move * 0.8 + 1) * YX,\r\n y1 + (kMinWidthT - 2) * XY + (kage.kMinWidthY * 2 - move * 0.8 + 1) * YY);\r\n //if(x1 < x2){\r\n // poly.reverse();\r\n //}\r\n polygons.push(poly);\r\n }\r\n }\r\n else{ //from bottom to up\r\n if(x1 == sx1){\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1);\r\n poly.push(x1 - kMinWidthT * 1.5, y1 + kage.kMinWidthY);\r\n poly.push(x1 - kMinWidthT * 0.5, y1 + kage.kMinWidthY * 3);\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT * XX, y1 - kMinWidthT * XY);\r\n poly.push(x1 - kMinWidthT * 1.5 * XX + kage.kMinWidthY * YX, y1 + kage.kMinWidthY * YY - kMinWidthT * 1.5 * XY);\r\n poly.push(x1 - kMinWidthT * 0.5 * XX + kage.kMinWidthY * 3 * YX, y1 + kage.kMinWidthY * 3 * YY - kMinWidthT * 0.5 * XY);\r\n //if(x1 < x2){\r\n // poly.reverse();\r\n //}\r\n polygons.push(poly);\r\n }\r\n }\r\n }\r\n \r\n //process for tail\r\n rad = Math.atan((y2 - sy2) / (x2 - sx2));\r\n if(sx2 < x2){ v = 1; } else{ v = -1; }\r\n YX = Math.sin(rad) * v * -1;\r\n YY = Math.cos(rad) * v;\r\n XX = Math.cos(rad) * v;\r\n XY = Math.sin(rad) * v;\r\n \r\n if(a2 == 1 || a2 == 8 || a2 == 15){ //the last filled circle ... it can change 15->5\r\n if(sx2 == x2){\r\n poly = new Polygon();\r\n if(kage.kUseCurve){\r\n // by curve path\r\n poly.push(x2 - kMinWidthT2, y2);\r\n poly.push(x2 - kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r\n poly.push(x2, y2 + kMinWidthT2);\r\n poly.push(x2 + kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r\n poly.push(x2 + kMinWidthT2, y2);\r\n } else {\r\n // by polygon\r\n poly.push(x2 - kMinWidthT2, y2);\r\n poly.push(x2 - kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r\n poly.push(x2, y2 + kMinWidthT2);\r\n poly.push(x2 + kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r\n poly.push(x2 + kMinWidthT2, y2);\r\n }\r\n polygons.push(poly);\r\n }\r\n else if(sy2 == y2){\r\n poly = new Polygon();\r\n if(kage.kUseCurve){\r\n // by curve path\r\n poly.push(x2, y2 - kMinWidthT2);\r\n poly.push(x2 + kMinWidthT2 * 0.9, y2 - kMinWidthT2 * 0.9, 1);\r\n poly.push(x2 + kMinWidthT2, y2);\r\n poly.push(x2 + kMinWidthT2 * 0.9, y2 + kMinWidthT2 * 0.9, 1);\r\n poly.push(x2, y2 + kMinWidthT2);\r\n } else {\r\n // by polygon\r\n poly.push(x2, y2 - kMinWidthT2);\r\n poly.push(x2 + kMinWidthT2 * 0.7, y2 - kMinWidthT2 * 0.7);\r\n poly.push(x2 + kMinWidthT2, y2);\r\n poly.push(x2 + kMinWidthT2 * 0.7, y2 + kMinWidthT2 * 0.7);\r\n poly.push(x2, y2 + kMinWidthT2);\r\n }\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n if(kage.kUseCurve){\r\n poly.push(x2 + Math.sin(rad) * kMinWidthT2 * v, y2 - Math.cos(rad) * kMinWidthT2 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.9 * v + Math.sin(rad) * kMinWidthT2 * 0.9 * v,\r\n y2 + Math.sin(rad) * kMinWidthT2 * 0.9 * v - Math.cos(rad) * kMinWidthT2 * 0.9 * v, 1);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * v, y2 + Math.sin(rad) * kMinWidthT2 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.9 * v - Math.sin(rad) * kMinWidthT2 * 0.9 * v,\r\n y2 + Math.sin(rad) * kMinWidthT2 * 0.9 * v + Math.cos(rad) * kMinWidthT2 * 0.9 * v, 1);\r\n poly.push(x2 - Math.sin(rad) * kMinWidthT2 * v, y2 + Math.cos(rad) * kMinWidthT2 * v);\r\n } else {\r\n poly.push(x2 + Math.sin(rad) * kMinWidthT2 * v, y2 - Math.cos(rad) * kMinWidthT2 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.7 * v + Math.sin(rad) * kMinWidthT2 * 0.7 * v,\r\n y2 + Math.sin(rad) * kMinWidthT2 * 0.7 * v - Math.cos(rad) * kMinWidthT2 * 0.7 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * v, y2 + Math.sin(rad) * kMinWidthT2 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT2 * 0.7 * v - Math.sin(rad) * kMinWidthT2 * 0.7 * v,\r\n y2 + Math.sin(rad) * kMinWidthT2 * 0.7 * v + Math.cos(rad) * kMinWidthT2 * 0.7 * v);\r\n poly.push(x2 - Math.sin(rad) * kMinWidthT2 * v, y2 + Math.cos(rad) * kMinWidthT2 * v);\r\n }\r\n polygons.push(poly);\r\n }\r\n }\r\n \r\n if(a2 == 9 || (a1 == 7 && a2 == 0)){ // Math.sinnyu & L2RD Harai ... no need for a2=9\r\n var type = (Math.atan2(Math.abs(y2 - sy2), Math.abs(x2 - sx2)) / Math.PI * 2 - 0.6);\r\n if(type > 0){\r\n type = type * 8;\r\n } else {\r\n type = type * 3;\r\n }\r\n var pm = 0;\r\n if(type < 0){\r\n pm = -1;\r\n } else {\r\n pm = 1;\r\n }\r\n if(sy2 == y2){\r\n poly = new Polygon();\r\n poly.push(x2, y2 + kMinWidthT * kage.kL2RDfatten);\r\n poly.push(x2, y2 - kMinWidthT * kage.kL2RDfatten);\r\n poly.push(x2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type), y2 + kMinWidthT * kage.kL2RDfatten * pm);\r\n polygons.push(poly);\r\n }\r\n else{\r\n poly = new Polygon();\r\n poly.push(x2 + kMinWidthT * kage.kL2RDfatten * YX, y2 + kMinWidthT * kage.kL2RDfatten * YY);\r\n poly.push(x2 - kMinWidthT * kage.kL2RDfatten * YX, y2 - kMinWidthT * kage.kL2RDfatten * YY);\r\n poly.push(x2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XX + kMinWidthT * kage.kL2RDfatten * pm * YX,\r\n y2 + kMinWidthT * kage.kL2RDfatten * Math.abs(type) * XY + kMinWidthT * kage.kL2RDfatten * pm * YY);\r\n polygons.push(poly);\r\n }\r\n }\r\n \r\n if(a2 == 15){ //jump up ... it can change 15->5\r\n // anytime same degree\r\n poly = new Polygon();\r\n if(y1 < y2){\r\n poly.push(x2, y2 - kMinWidthT + 1);\r\n poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * 5);\r\n poly.push(x2, y2 - kMinWidthT - kage.kWidth * 5);\r\n poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r\n } else {\r\n poly.push(x2, y2 + kMinWidthT - 1);\r\n poly.push(x2 - 2, y2 + kMinWidthT + kage.kWidth * 5);\r\n poly.push(x2, y2 + kMinWidthT + kage.kWidth * 5);\r\n poly.push(x2 + kMinWidthT, y2 + kMinWidthT - 1);\r\n }\r\n polygons.push(poly);\r\n }\r\n \r\n if(a2 == 14){ //jump to left, allways go left\r\n poly = new Polygon();\r\n poly.push(x2, y2);\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2 - kage.kWidth * 4 * Math.min(1 - opt2 / 10, Math.pow(kMinWidthT / kage.kMinWidthT, 3)), y2 - kMinWidthT);\r\n poly.push(x2 - kage.kWidth * 4 * Math.min(1 - opt2 / 10, Math.pow(kMinWidthT / kage.kMinWidthT, 3)), y2 - kMinWidthT * 0.5);\r\n //poly.reverse();\r\n polygons.push(poly);\r\n }\r\n }\r\n else{ //gothic\r\n if(a1 % 10 == 2){\r\n if(x1 == sx1){\r\n if(y1 < sy1){ y1 = y1 - kage.kWidth; } else{ y1 = y1 + kage.kWidth; }\r\n }\r\n else if(y1 == sy1){\r\n if(x1 < sx1){ x1 = x1 - kage.kWidth; } else{ x1 = x1 + kage.kWidth; }\r\n }\r\n else{\r\n rad = Math.atan((sy1 - y1) / (sx1 - x1));\r\n if(x1 < sx1){ v = 1; } else{ v = -1; }\r\n x1 = x1 - kage.kWidth * Math.cos(rad) * v;\r\n y1 = y1 - kage.kWidth * Math.sin(rad) * v;\r\n }\r\n }\r\n \r\n if(a1 % 10 == 3){\r\n if(x1 == sx1){\r\n if(y1 < sy1){\r\n y1 = y1 - kage.kWidth * kage.kKakato;\r\n }\r\n else{\r\n y1 = y1 + kage.kWidth * kage.kKakato;\r\n }\r\n }\r\n else if(y1 == sy1){\r\n if(x1 < sx1){\r\n x1 = x1 - kage.kWidth * kage.kKakato;\r\n }\r\n else{\r\n x1 = x1 + kage.kWidth * kage.kKakato;\r\n }\r\n }\r\n else{\r\n rad = Math.atan((sy1 - y1) / (sx1 - x1));\r\n if(x1 < sx1){ v = 1; } else{ v = -1; }\r\n x1 = x1 - kage.kWidth * Math.cos(rad) * v * kage.kKakato;\r\n y1 = y1 - kage.kWidth * Math.sin(rad) * v * kage.kKakato;\r\n }\r\n }\r\n if(a2 % 10 == 2){\r\n if(sx2 == x2){\r\n if(sy2 < y2){ y2 = y2 + kage.kWidth; } else{ y2 = y2 - kage.kWidth; }\r\n }\r\n else if(sy2 == y2){\r\n if(sx2 < x2){ x2 = x2 + kage.kWidth; } else{ x2 = x2 - kage.kWidth; }\r\n }\r\n else{\r\n rad = Math.atan((y2 - sy2) / (x2 - sx2));\r\n if(sx2 < x2){ v = 1; } else{ v = -1; }\r\n x2 = x2 + kage.kWidth * Math.cos(rad) * v;\r\n y2 = y2 + kage.kWidth * Math.sin(rad) * v;\r\n }\r\n }\r\n \r\n if(a2 % 10 == 3){\r\n if(sx2 == x2){\r\n if(sy2 < y2){\r\n y2 = y2 + kage.kWidth * kage.kKakato;\r\n }\r\n else{\r\n y2 = y2 - kage.kWidth * kage.kKakato;\r\n }\r\n }\r\n else if(sy2 == y2){\r\n if(sx2 < x2){\r\n x2 = x2 + kage.kWidth * kage.kKakato;\r\n }\r\n else{\r\n x2 = x2 - kage.kWidth * kage.kKakato;\r\n }\r\n }\r\n else{\r\n rad = Math.atan((y2 - sy2) / (x2 - sx2));\r\n if(sx2 < x2){ v = 1; } else{ v = -1; }\r\n x2 = x2 + kage.kWidth * Math.cos(rad) * v * kage.kKakato;\r\n y2 = y2 + kage.kWidth * Math.sin(rad) * v * kage.kKakato;\r\n }\r\n }\r\n \r\n poly = new Polygon();\r\n poly2 = new Polygon();\r\n \r\n for(tt = 0; tt <= 1000; tt = tt + kage.kRate){\r\n t = tt / 1000;\r\n \r\n if(sx1 == sx2 && sy1 == sy2){\r\n //calculating each point\r\n x = ((1.0 - t) * (1.0 - t) * x1 + 2.0 * t * (1.0 - t) * sx1 + t * t * x2);\r\n y = ((1.0 - t) * (1.0 - t) * y1 + 2.0 * t * (1.0 - t) * sy1 + t * t * y2);\r\n \r\n //SESSEN NO KATAMUKI NO KEISAN(BIBUN)\r\n ix = (x1 - 2.0 * sx1 + x2) * 2.0 * t + (-2.0 * x1 + 2.0 * sx1);\r\n iy = (y1 - 2.0 * sy1 + y2) * 2.0 * t + (-2.0 * y1 + 2.0 * sy1);\r\n } else {\r\n }\r\n //SESSEN NI SUICHOKU NA CHOKUSEN NO KEISAN\r\n if(kage.kShotai == kage.kMincho){ //always false ?\r\n if(ix != 0 && iy != 0){\r\n ir = Math.atan(iy / ix * -1.0);\r\n ia = Math.sin(ir) * kage.kMinWidthT;\r\n ib = Math.cos(ir) * kage.kMinWidthT;\r\n }\r\n else if(ix == 0){\r\n ia = kage.kMinWidthT;\r\n ib = 0;\r\n }\r\n else{\r\n ia = 0;\r\n ib = kage.kMinWidthT;\r\n }\r\n ia = ia * Math.sqrt(1.0 - t);\r\n ib = ib * Math.sqrt(1.0 - t);\r\n }\r\n else{\r\n if(ix != 0 && iy != 0){\r\n ir = Math.atan(iy / ix * -1.0);\r\n ia = Math.sin(ir) * kage.kWidth;\r\n ib = Math.cos(ir) * kage.kWidth;\r\n }\r\n else if(ix == 0){\r\n ia = kage.kWidth;\r\n ib = 0;\r\n }\r\n else{\r\n ia = 0;\r\n ib = kage.kWidth;\r\n }\r\n }\r\n \r\n //reverse if vector is going 2nd/3rd quadrants\r\n if(ix <= 0){\r\n ia = ia * -1;\r\n ib = ib * -1;\r\n }\r\n \r\n //save to polygon\r\n poly.push(x - ia, y - ib);\r\n poly2.push(x + ia, y + ib);\r\n }\r\n \r\n poly2.reverse();\r\n poly.concat(poly2);\r\n polygons.push(poly);\r\n }\r\n}\r\n\r\nfunction cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a1, a2){\r\n cdDrawCurveU(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a1, a2);\r\n}\r\n\r\nfunction cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a1, a2){\r\n cdDrawCurveU(kage, polygons, x1, y1, x2, y2, x2, y2, x3, y3, a1, a2);\r\n}\r\n\r\nfunction cdDrawLine(kage, polygons, tx1, ty1, tx2, ty2, ta1, ta2){\r\n var rad;\r\n var v, x1, y1, x2, y2;\r\n var a1, a2, opt1, opt2;\r\n var XX, XY, YX, YY;\r\n var poly;\r\n var kMinWidthT;\r\n \r\n if(kage.kShotai == kage.kMincho){ //mincho\r\n x1 = tx1;\r\n y1 = ty1;\r\n x2 = tx2;\r\n y2 = ty2;\r\n a1 = ta1 % 1000;\r\n a2 = ta2 % 100;\r\n opt1 = Math.floor(ta1 / 1000);\r\n opt2 = Math.floor(ta2 / 100);\r\n \r\n kMinWidthT = kage.kMinWidthT - opt1 / 2;\r\n \r\n if(x1 == x2){ //if TATE stroke, use y-axis\r\n poly = new Polygon(4);\r\n switch(a1){\r\n case 0:\r\n poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY / 2);\r\n poly.set(0, x1 + kMinWidthT, y1 + kage.kMinWidthY / 2);\r\n break;\r\n case 1:\r\n case 6: //... no need\r\n case 22:\r\n poly.set(3, x1 - kMinWidthT, y1);\r\n poly.set(0, x1 + kMinWidthT, y1);\r\n break;\r\n case 12:\r\n poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY - kMinWidthT);\r\n poly.set(0, x1 + kMinWidthT, y1 - kage.kMinWidthY);\r\n break;\r\n case 32:\r\n poly.set(3, x1 - kMinWidthT, y1 - kage.kMinWidthY);\r\n poly.set(0, x1 + kMinWidthT, y1 - kage.kMinWidthY);\r\n break;\r\n }\r\n \r\n switch(a2){\r\n case 0:\r\n if(a1 == 6){ //KAGI's tail ... no need\r\n poly.set(2, x2 - kMinWidthT, y2);\r\n poly.set(1, x2 + kMinWidthT, y2);\r\n }\r\n else{\r\n poly.set(2, x2 - kMinWidthT, y2 + kMinWidthT / 2);\r\n poly.set(1, x2 + kMinWidthT, y2 - kMinWidthT / 2);\r\n }\r\n break;\r\n case 1:\r\n poly.set(2, x2 - kMinWidthT, y2);\r\n poly.set(1, x2 + kMinWidthT, y2);\r\n break;\r\n case 13:\r\n poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoL[opt2] + kMinWidthT);\r\n poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoL[opt2]);\r\n break;\r\n case 23:\r\n poly.set(2, x2 - kMinWidthT, y2 + kage.kAdjustKakatoR[opt2] + kMinWidthT);\r\n poly.set(1, x2 + kMinWidthT, y2 + kage.kAdjustKakatoR[opt2]);\r\n break;\r\n case 32:\r\n poly.set(2, x2 - kMinWidthT, y2 + kage.kMinWidthY);\r\n poly.set(1, x2 + kMinWidthT, y2 + kage.kMinWidthY);\r\n break;\r\n }\r\n \r\n polygons.push(poly);\r\n \r\n if(a1 == 22){ //box's right top corner\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r\n poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r\n poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r\n poly.push(x1 + kMinWidthT, y1 + kMinWidthT);\r\n poly.push(x1 - kMinWidthT, y1);\r\n polygons.push(poly);\r\n }\r\n \r\n if(a1 == 0){ //beginning of the stroke\r\n poly = new Polygon();\r\n poly.push(x1 + kMinWidthT, y1 + kage.kMinWidthY * 0.5);\r\n poly.push(x1 + kMinWidthT + kMinWidthT * 0.5, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY);\r\n poly.push(x1 + kMinWidthT - 2, y1 + kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2 + 1);\r\n polygons.push(poly);\r\n }\r\n \r\n if((a1 == 6 && a2 == 0) || a2 == 1){ //KAGI NO YOKO BOU NO SAIGO NO MARU ... no need only used at 1st=yoko\r\n poly = new Polygon();\r\n\tif(kage.kUseCurve){\r\n poly.push(x2 - kMinWidthT, y2);\r\n poly.push(x2 - kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r\n poly.push(x2, y2 + kMinWidthT);\r\n poly.push(x2 + kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r\n poly.push(x2 + kMinWidthT, y2);\r\n } else {\r\n poly.push(x2 - kMinWidthT, y2);\r\n poly.push(x2 - kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r\n poly.push(x2, y2 + kMinWidthT);\r\n poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r\n poly.push(x2 + kMinWidthT, y2);\r\n }\r\n //poly.reverse(); // for fill-rule\r\n polygons.push(poly);\r\n }\r\n }\r\n else if(y1 == y2){ //if it is YOKO stroke, use x-axis\r\n if(a1 == 6){ //if it is KAGI's YOKO stroke, get bold\r\n poly = new Polygon();\r\n poly.push(x1, y1 - kMinWidthT);\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2, y2 + kMinWidthT);\r\n poly.push(x1, y1 + kMinWidthT);\r\n polygons.push(poly);\r\n \r\n if(a2 == 1 || a2 == 0 || a2 == 5){ // no need a2=1\r\n //KAGI NO YOKO BOU NO SAIGO NO MARU\r\n poly = new Polygon();\r\n if(kage.kUseCurve){\r\n if(x1 < x2){\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2 + kMinWidthT * 0.9, y2 - kMinWidthT * 0.9, 1);\r\n poly.push(x2 + kMinWidthT, y2);\r\n poly.push(x2 + kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r\n poly.push(x2, y2 + kMinWidthT);\r\n } else {\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2 - kMinWidthT * 0.9, y2 - kMinWidthT * 0.9, 1);\r\n poly.push(x2 - kMinWidthT, y2);\r\n poly.push(x2 - kMinWidthT * 0.9, y2 + kMinWidthT * 0.9, 1);\r\n poly.push(x2, y2 + kMinWidthT);\r\n }\r\n } else {\r\n if(x1 < x2){\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2 + kMinWidthT * 0.6, y2 - kMinWidthT * 0.6);\r\n poly.push(x2 + kMinWidthT, y2);\r\n poly.push(x2 + kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r\n poly.push(x2, y2 + kMinWidthT);\r\n } else {\r\n poly.push(x2, y2 - kMinWidthT);\r\n poly.push(x2 - kMinWidthT * 0.6, y2 - kMinWidthT * 0.6);\r\n poly.push(x2 - kMinWidthT, y2);\r\n poly.push(x2 - kMinWidthT * 0.6, y2 + kMinWidthT * 0.6);\r\n poly.push(x2, y2 + kMinWidthT);\r\n }\r\n }\r\n polygons.push(poly);\r\n }\r\n \r\n if(a2 == 5){\r\n //KAGI NO YOKO BOU NO HANE\r\n poly = new Polygon();\r\n if(x1 < x2){\r\n poly.push(x2, y2 - kMinWidthT + 1);\r\n poly.push(x2 + 2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r\n poly.push(x2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r\n poly.push(x2 - kMinWidthT, y2 - kMinWidthT + 1);\r\n } else {\r\n poly.push(x2, y2 - kMinWidthT + 1);\r\n poly.push(x2 - 2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r\n poly.push(x2, y2 - kMinWidthT - kage.kWidth * (4 * (1 - opt1 / kage.kAdjustMageStep) + 1));\r\n poly.push(x2 + kMinWidthT, y2 - kMinWidthT + 1);\r\n }\r\n //poly.reverse(); // for fill-rule\r\n polygons.push(poly);\r\n }\r\n }\r\n else{\r\n //always same\r\n poly = new Polygon(4);\r\n poly.set(0, x1, y1 - kage.kMinWidthY);\r\n poly.set(1, x2, y2 - kage.kMinWidthY);\r\n poly.set(2, x2, y2 + kage.kMinWidthY);\r\n poly.set(3, x1, y1 + kage.kMinWidthY);\r\n polygons.push(poly);\r\n \r\n //UROKO\r\n if(a2 == 0){\r\n poly = new Polygon();\r\n poly.push(x2, y2 - kage.kMinWidthY);\r\n poly.push(x2 - kage.kAdjustUrokoX[opt2], y2);\r\n poly.push(x2 - kage.kAdjustUrokoX[opt2] / 2, y2 - kage.kAdjustUrokoY[opt2]);\r\n polygons.push(poly);\r\n }\r\n }\r\n }\r\n else{ //for others, use x-axis\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if((Math.abs(y2 - y1) < Math.abs(x2 - x1)) && (a1 != 6) && (a2 != 6) && !(x1 > x2)){ //ASAI KAUDO\r\n //always same\r\n poly = new Polygon(4);\r\n poly.set(0, x1 + Math.sin(rad) * kage.kMinWidthY, y1 - Math.cos(rad) * kage.kMinWidthY);\r\n poly.set(1, x2 + Math.sin(rad) * kage.kMinWidthY, y2 - Math.cos(rad) * kage.kMinWidthY);\r\n poly.set(2, x2 - Math.sin(rad) * kage.kMinWidthY, y2 + Math.cos(rad) * kage.kMinWidthY);\r\n poly.set(3, x1 - Math.sin(rad) * kage.kMinWidthY, y1 + Math.cos(rad) * kage.kMinWidthY);\r\n polygons.push(poly);\r\n \r\n //UROKO\r\n if(a2 == 0){\r\n poly = new Polygon();\r\n poly.push(x2 + Math.sin(rad) * kage.kMinWidthY, y2 - Math.cos(rad) * kage.kMinWidthY);\r\n poly.push(x2 - Math.cos(rad) * kage.kAdjustUrokoX[opt2], y2 - Math.sin(rad) * kage.kAdjustUrokoX[opt2]);\r\n poly.push(x2 - Math.cos(rad) * kage.kAdjustUrokoX[opt2] / 2 + Math.sin(rad) * kage.kAdjustUrokoX[opt2] / 2, y2 - Math.sin(rad) * kage.kAdjustUrokoY[opt2] - Math.cos(rad) * kage.kAdjustUrokoY[opt2]);\r\n polygons.push(poly);\r\n }\r\n }\r\n \r\n else{ //KAKUDO GA FUKAI or KAGI NO YOKO BOU\r\n if(x1 > x2){ v = -1; } else{ v = 1; }\r\n poly = new Polygon(4);\r\n switch(a1){\r\n case 0:\r\n poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v + kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r\n y1 - Math.cos(rad) * kMinWidthT * v + kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r\n poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * 0.5 * v,\r\n y1 + Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * 0.5 * v);\r\n break;\r\n case 1:\r\n case 6:\r\n poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v, y1 - Math.cos(rad) * kMinWidthT * v);\r\n poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v, y1 + Math.cos(rad) * kMinWidthT * v);\r\n break;\r\n case 12:\r\n poly.set(0, x1 + Math.sin(rad) * kMinWidthT * v - kage.kMinWidthY * Math.cos(rad) * v,\r\n y1 - Math.cos(rad) * kMinWidthT * v - kage.kMinWidthY * Math.sin(rad) * v);\r\n poly.set(3, x1 - Math.sin(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.cos(rad) * v,\r\n y1 + Math.cos(rad) * kMinWidthT * v - (kMinWidthT + kage.kMinWidthY) * Math.sin(rad) * v);\r\n break;\r\n case 22:\r\n poly.set(0, x1 + (kMinWidthT * v + 1) / Math.sin(rad), y1 + 1);\r\n poly.set(3, x1 - (kMinWidthT * v) / Math.sin(rad), y1);\r\n break;\r\n case 32:\r\n poly.set(0, x1 + (kMinWidthT * v) / Math.sin(rad), y1);\r\n poly.set(3, x1 - (kMinWidthT * v) / Math.sin(rad), y1);\r\n break;\r\n }\r\n \r\n switch(a2){\r\n case 0:\r\n if(a1 == 6){\r\n poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r\n poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r\n }\r\n else{\r\n poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v - kMinWidthT * 0.5 * Math.cos(rad) * v,\r\n y2 - Math.cos(rad) * kMinWidthT * v - kMinWidthT * 0.5 * Math.sin(rad) * v);\r\n poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + kMinWidthT * 0.5 * Math.cos(rad) * v,\r\n y2 + Math.cos(rad) * kMinWidthT * v + kMinWidthT * 0.5 * Math.sin(rad) * v);\r\n }\r\n break;\r\n case 1: // is needed?\r\n case 5:\r\n poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r\n poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r\n break;\r\n case 13:\r\n poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.cos(rad) * v,\r\n y2 - Math.cos(rad) * kMinWidthT * v + kage.kAdjustKakatoL[opt2] * Math.sin(rad) * v);\r\n poly.set(2, x2 - Math.sin(rad) * kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kMinWidthT) * Math.cos(rad) * v,\r\n y2 + Math.cos(rad) * kMinWidthT * v + (kage.kAdjustKakatoL[opt2] + kMinWidthT) * Math.sin(rad) * v);\r\n break;\r\n case 23:\r\n poly.set(1, x2 + Math.sin(rad) * kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.cos(rad) * v,\r\n y2 - Math.cos(rad) * kMinWidthT * v + kage.kAdjustKakatoR[opt2] * Math.sin(rad) * v);\r\n poly.set(2,\r\n x2 - Math.sin(rad) * kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kMinWidthT) * Math.cos(rad) * v,\r\n y2 + Math.cos(rad) * kMinWidthT * v + (kage.kAdjustKakatoR[opt2] + kMinWidthT) * Math.sin(rad) * v);\r\n break;\r\n case 32:\r\n poly.set(1, x2 + (kMinWidthT * v) / Math.sin(rad), y2);\r\n poly.set(2, x2 - (kMinWidthT * v) / Math.sin(rad), y2);\r\n break;\r\n }\r\n \r\n polygons.push(poly);\r\n \r\n if((a1 == 6) && (a2 == 0 || a2 == 5)){ //KAGI NO YOKO BOU NO SAIGO NO MARU\r\n poly = new Polygon();\r\n if(kage.kUseCurve){\r\n poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r\n poly.push(x2 - Math.cos(rad) * kMinWidthT * 0.9 * v + Math.sin(rad) * kMinWidthT * 0.9 * v,\r\n y2 + Math.sin(rad) * kMinWidthT * 0.9 * v - Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.9 * v - Math.sin(rad) * kMinWidthT * 0.9 * v,\r\n y2 + Math.sin(rad) * kMinWidthT * 0.9 * v + Math.cos(rad) * kMinWidthT * 0.9 * v, 1);\r\n poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r\n } else {\r\n poly.push(x2 + Math.sin(rad) * kMinWidthT * v, y2 - Math.cos(rad) * kMinWidthT * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v + Math.sin(rad) * kMinWidthT * 0.6 * v,\r\n y2 + Math.sin(rad) * kMinWidthT * 0.8 * v - Math.cos(rad) * kMinWidthT * 0.6 * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT * v, y2 + Math.sin(rad) * kMinWidthT * v);\r\n poly.push(x2 + Math.cos(rad) * kMinWidthT * 0.8 * v - Math.sin(rad) * kMinWidthT * 0.6 * v,\r\n y2 + Math.sin(rad) * kMinWidthT * 0.8 * v + Math.cos(rad) * kMinWidthT * 0.6 * v);\r\n poly.push(x2 - Math.sin(rad) * kMinWidthT * v, y2 + Math.cos(rad) * kMinWidthT * v);\r\n }\r\n polygons.push(poly);\r\n }\r\n \r\n if(a1 == 6 && a2 == 5){\r\n //KAGI NO YOKO BOU NO HANE\r\n poly = new Polygon();\r\n if(x1 < x2){\r\n poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v, y2 - (kMinWidthT - 1) * Math.cos(rad) * v);\r\n poly.push(x2 + 2 * Math.cos(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r\n y2 + 2 * Math.sin(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r\n poly.push(x2 + (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r\n y2 - (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r\n poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r\n y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r\n } else {\r\n poly.push(x2 - (kMinWidthT - 1) * Math.sin(rad) * v, y2 + (kMinWidthT - 1) * Math.cos(rad) * v);\r\n poly.push(x2 + 2 * Math.cos(rad) * v - (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r\n y2 + 2 * Math.sin(rad) * v + (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r\n poly.push(x2 - (kMinWidthT + kage.kWidth * 5) * Math.sin(rad) * v,\r\n y2 + (kMinWidthT + kage.kWidth * 5) * Math.cos(rad) * v);\r\n poly.push(x2 + (kMinWidthT - 1) * Math.sin(rad) * v - kMinWidthT * Math.cos(rad) * v,\r\n y2 - (kMinWidthT - 1) * Math.cos(rad) * v - kMinWidthT * Math.sin(rad) * v);\r\n }\r\n polygons.push(poly);\r\n }\r\n \r\n if(a1 == 22){ //SHIKAKU MIGIUE UROKO NANAME DEMO MASSUGU MUKI\r\n poly = new Polygon();\r\n poly.push(x1 - kMinWidthT, y1 - kage.kMinWidthY);\r\n poly.push(x1, y1 - kage.kMinWidthY - kage.kWidth);\r\n poly.push(x1 + kMinWidthT + kage.kWidth, y1 + kage.kMinWidthY);\r\n poly.push(x1 + kMinWidthT, y1 + kMinWidthT - 1);\r\n poly.push(x1 - kMinWidthT, y1 + kMinWidthT + 4);\r\n polygons.push(poly);\r\n }\r\n \r\n XX = Math.sin(rad) * v;\r\n XY = Math.cos(rad) * v * -1;\r\n YX = Math.cos(rad) * v;\r\n YY = Math.sin(rad) * v;\r\n \r\n if(a1 == 0){ //beginning of the storke\r\n poly = new Polygon();\r\n poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5) * YX,\r\n y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5) * YY);\r\n poly.push(x1 + (kMinWidthT + kMinWidthT * 0.5) * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YX,\r\n y1 + (kMinWidthT + kMinWidthT * 0.5) * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY) * YY);\r\n poly.push(x1 + kMinWidthT * XX + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YX - 2 * XX,\r\n y1 + kMinWidthT * XY + (kage.kMinWidthY * 0.5 + kage.kMinWidthY * 2) * YY + 1 * XY);\r\n polygons.push(poly);\r\n }\r\n }\r\n }\r\n }\r\n else{ //gothic\r\n if(tx1 == tx2){ //if TATE stroke, use y-axis\r\n if(ty1 > ty2){\r\n x1 = tx2;\r\n y1 = ty2;\r\n x2 = tx1;\r\n y2 = ty1;\r\n a1 = ta2;\r\n a2 = ta1;\r\n }\r\n else{\r\n x1 = tx1;\r\n y1 = ty1;\r\n x2 = tx2;\r\n y2 = ty2;\r\n a1 = ta1;\r\n a2 = ta2;\r\n }\r\n \r\n if(a1 % 10 == 2){ y1 = y1 - kage.kWidth; }\r\n if(a2 % 10 == 2){ y2 = y2 + kage.kWidth; }\r\n if(a1 % 10 == 3){ y1 = y1 - kage.kWidth * kage.kKakato; }\r\n if(a2 % 10 == 3){ y2 = y2 + kage.kWidth * kage.kKakato; }\r\n \r\n poly = new Polygon();\r\n poly.push(x1 - kage.kWidth, y1);\r\n poly.push(x2 - kage.kWidth, y2);\r\n poly.push(x2 + kage.kWidth, y2);\r\n poly.push(x1 + kage.kWidth, y1);\r\n //poly.reverse(); // for fill-rule\r\n \r\n polygons.push(poly);\r\n }\r\n else if(ty1 == ty2){ //if YOKO stroke, use x-axis\r\n if(tx1 > tx2){\r\n x1 = tx2;\r\n y1 = ty2;\r\n x2 = tx1;\r\n y2 = ty1;\r\n a1 = ta2;\r\n a2 = ta1;\r\n }\r\n else{\r\n x1 = tx1;\r\n y1 = ty1;\r\n x2 = tx2;\r\n y2 = ty2;\r\n a1 = ta1;\r\n a2 = ta2;\r\n }\r\n if(a1 % 10 == 2){ x1 = x1 - kage.kWidth; }\r\n if(a2 % 10 == 2){ x2 = x2 + kage.kWidth; }\r\n if(a1 % 10 == 3){ x1 = x1 - kage.kWidth * kage.kKakato; }\r\n if(a2 % 10 == 3){ x2 = x2 + kage.kWidth * kage.kKakato; }\r\n \r\n poly = new Polygon();\r\n poly.push(x1, y1 - kage.kWidth);\r\n poly.push(x2, y2 - kage.kWidth);\r\n poly.push(x2, y2 + kage.kWidth);\r\n poly.push(x1, y1 + kage.kWidth);\r\n \r\n polygons.push(poly);\r\n }\r\n else{ //for others, use x-axis\r\n if(tx1 > tx2){\r\n x1 = tx2;\r\n y1 = ty2;\r\n x2 = tx1;\r\n y2 = ty1;\r\n a1 = ta2;\r\n a2 = ta1;\r\n }\r\n else{\r\n x1 = tx1;\r\n y1 = ty1;\r\n x2 = tx2;\r\n y2 = ty2;\r\n a1 = ta1;\r\n a2 = ta2;\r\n }\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(a1 % 10 == 2){\r\n x1 = x1 - kage.kWidth * Math.cos(rad);\r\n y1 = y1 - kage.kWidth * Math.sin(rad);\r\n }\r\n if(a2 % 10 == 2){\r\n x2 = x2 + kage.kWidth * Math.cos(rad);\r\n y2 = y2 + kage.kWidth * Math.sin(rad);\r\n }\r\n if(a1 % 10 == 3){\r\n x1 = x1 - kage.kWidth * Math.cos(rad) * kage.kKakato;\r\n y1 = y1 - kage.kWidth * Math.sin(rad) * kage.kKakato;\r\n }\r\n if(a2 % 10 == 3){\r\n x2 = x2 + kage.kWidth * Math.cos(rad) * kage.kKakato;\r\n y2 = y2 + kage.kWidth * Math.sin(rad) * kage.kKakato;\r\n }\r\n \r\n //SUICHOKU NO ICHI ZURASHI HA Math.sin TO Math.cos NO IREKAE + x-axis MAINASU KA\r\n poly = new Polygon();\r\n poly.push(x1 + Math.sin(rad) * kage.kWidth, y1 - Math.cos(rad) * kage.kWidth);\r\n poly.push(x2 + Math.sin(rad) * kage.kWidth, y2 - Math.cos(rad) * kage.kWidth);\r\n poly.push(x2 - Math.sin(rad) * kage.kWidth, y2 + Math.cos(rad) * kage.kWidth);\r\n poly.push(x1 - Math.sin(rad) * kage.kWidth, y1 + Math.cos(rad) * kage.kWidth);\r\n \r\n polygons.push(poly);\r\n }\r\n }\r\n}function dfDrawFont(kage, polygons, a1, a2, a3, x1, y1, x2, y2, x3, y3, x4, y4){\r\n var tx1, tx2, tx3, tx4, ty1, ty2, ty3, ty4, v;\r\n var rad;\r\n\t\r\n if(kage.kShotai == kage.kMincho){\r\n switch(a1 % 100){ // ... no need to divide\r\n case 0:\r\n break;\r\n case 1:\r\n if(a3 % 100 == 4){\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){ // ... no need\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, x2 - kage.kMage * (((kage.kAdjustTateStep + 4) - Math.floor(a2 / 1000)) / (kage.kAdjustTateStep + 4)), y2, 1 + (a2 - a2 % 1000), a3 + 10);\r\n }\r\n else{\r\n cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, a3);\r\n }\r\n break;\r\n case 2:\r\n //case 12: // ... no need\r\n if(a3 % 100 == 4){\r\n if(x2 == x3){\r\n tx1 = x3;\r\n ty1 = y3 - kage.kMage;\r\n }\r\n else if(y2 == y3){\r\n tx1 = x3 - kage.kMage;\r\n ty1 = y3;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx1 = x3 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y3 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x3, y3, x3 - kage.kMage, y3, 1, a3 + 10);\r\n }\r\n else if(a3 == 5){\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, 15);\r\n }\r\n else{\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, a3);\r\n }\r\n break;\r\n case 3:\r\n if(a3 % 1000 == 5){\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else { v = -1; }\r\n tx2 = x2 + kage.kMage * v;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r\n }\r\n tx3 = x3;\r\n ty3 = y3;\r\n \r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1 + (a3 - a3 % 1000));\r\n if((x2 < x3 && tx3 - tx2 > 0) || (x2 > x3 && tx2 - tx3 > 0)){ // for closer position\r\n cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6 + (a3 - a3 % 1000), 5); // bolder by force\r\n }\r\n }\r\n else{\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else { v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * v;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1 + (a2 - a2 % 1000) * 10, 1 + (a3 - a3 % 1000));\r\n cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6 + (a3 - a3 % 1000), a3); // bolder by force\r\n }\r\n break;\r\n case 12:\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, 1);\r\n cdDrawLine(kage, polygons, x3, y3, x4, y4, 6, a3);\r\n break;\r\n case 4:\r\n rate = 6;\r\n if((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2) < 14400){ // smaller than 120 x 120\r\n rate = Math.sqrt((x3 - x2) * (x3 - x2) + (y3 - y2) * (y3 - y2)) / 120 * 6;\r\n }\r\n if(a3 == 5){\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v * rate;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v * rate;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v * rate;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v * rate;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v * rate;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else { v = -1; }\r\n tx2 = x2 + kage.kMage * v * rate;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v * rate;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v * rate;\r\n }\r\n tx3 = x3;\r\n ty3 = y3;\r\n \r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r\n if(tx3 - tx2 > 0){ // for closer position\r\n cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 6, 5); // bolder by force\r\n }\r\n }\r\n else{\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else { v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v * rate;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v * rate;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v * rate;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v * rate;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v * rate;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * v * rate;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v * rate;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v * rate;\r\n }\r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r\n cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 6, a3); // bolder by force\r\n }\r\n break;\r\n case 6:\r\n if(a3 % 100 == 4){\r\n if(x3 == x4){\r\n tx1 = x4;\r\n ty1 = y4 - kage.kMage;\r\n }\r\n else if(y3 == y4){\r\n tx1 = x4 - kage.kMage;\r\n ty1 = y4;\r\n }\r\n else{\r\n rad = Math.atan((y4 - y3) / (x4 - x3));\r\n if(x3 < x4){ v = 1; } else{ v = -1; }\r\n tx1 = x4 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y4 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x4, y4, x4 - kage.kMage, y4, 1, a3 + 10);\r\n }\r\n else if(a3 == 5){\r\n cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a2, 15);\r\n }\r\n else{\r\n cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a2, a3);\r\n }\r\n break;\r\n case 7:\r\n cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, 1);\r\n cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1 + (a2 - a2 % 1000), a3);\r\n break;\r\n case 9: // may not be exist ... no need\r\n //kageCanvas[y1][x1] = 0;\r\n //kageCanvas[y2][x2] = 0;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n \r\n else{ // gothic\r\n switch(a1 % 100){\r\n case 0:\r\n break;\r\n case 1:\r\n if(a3 == 4){\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, x2 - kage.kMage * 2, y2 - kage.kMage * 0.5, 1, 0);\r\n }\r\n else{\r\n cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, a3);\r\n }\r\n break;\r\n case 2:\r\n case 12:\r\n if(a3 == 4){\r\n if(x2 == x3){\r\n tx1 = x3;\r\n ty1 = y3 - kage.kMage;\r\n }\r\n else if(y2 == y3){\r\n tx1 = x3 - kage.kMage;\r\n ty1 = y3;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx1 = x3 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y3 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x3, y3, x3 - kage.kMage * 2, y3 - kage.kMage * 0.5, 1, 0);\r\n }\r\n else if(a3 == 5){\r\n tx1 = x3 + kage.kMage;\r\n ty1 = y3;\r\n tx2 = tx1 + kage.kMage * 0.5;\r\n ty2 = y3 - kage.kMage * 2;\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, 1);\r\n cdDrawCurve(kage, polygons, x3, y3, tx1, ty1, tx2, ty2, 1, 0);\r\n }\r\n else{\r\n cdDrawCurve(kage, polygons, x1, y1, x2, y2, x3, y3, a2, a3);\r\n }\r\n break;\r\n case 3:\r\n if(a3 == 5){\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * v;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r\n }\r\n tx3 = x3 - kage.kMage;\r\n ty3 = y3;\r\n tx4 = x3 + kage.kMage * 0.5;\r\n ty4 = y3 - kage.kMage * 2;\r\n \r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r\n cdDrawLine(kage, polygons, tx2, ty2, tx3, ty3, 1, 1);\r\n cdDrawCurve(kage, polygons, tx3, ty3, x3, y3, tx4, ty4, 1, 0);\r\n }\r\n else{\r\n if(x1 == x2){\r\n if(y1 < y2){ v = 1; } else{ v = -1; }\r\n tx1 = x2;\r\n ty1 = y2 - kage.kMage * v;\r\n }\r\n else if(y1 == y2){\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * v;\r\n ty1 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y2 - y1) / (x2 - x1));\r\n if(x1 < x2){ v = 1; } else{ v = -1; }\r\n tx1 = x2 - kage.kMage * Math.cos(rad) * v;\r\n ty1 = y2 - kage.kMage * Math.sin(rad) * v;\r\n }\r\n if(x2 == x3){\r\n if(y2 < y3){ v = 1; } else{ v = -1; }\r\n tx2 = x2;\r\n ty2 = y2 + kage.kMage * v;\r\n }\r\n else if(y2 == y3){\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * v;\r\n ty2 = y2;\r\n }\r\n else{\r\n rad = Math.atan((y3 - y2) / (x3 - x2));\r\n if(x2 < x3){ v = 1; } else{ v = -1; }\r\n tx2 = x2 + kage.kMage * Math.cos(rad) * v;\r\n ty2 = y2 + kage.kMage * Math.sin(rad) * v;\r\n }\r\n \r\n cdDrawLine(kage, polygons, x1, y1, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x2, y2, tx2, ty2, 1, 1);\r\n cdDrawLine(kage, polygons, tx2, ty2, x3, y3, 1, a3);\r\n }\r\n break;\r\n case 6:\r\n if(a3 == 5){\r\n tx1 = x4 - kage.kMage;\r\n ty1 = y4;\r\n tx2 = x4 + kage.kMage * 0.5;\r\n ty2 = y4 - kage.kMage * 2;\r\n /*\r\n\t\t\t\tcdDrawCurve(x1, y1, x2, y2, (x2 + x3) / 2, (y2 + y3) / 2, a2, 1);\r\n\t\t\t\tcdDrawCurve((x2 + x3) / 2, (y2 + y3) / 2, x3, y3, tx1, ty1, 1, 1);\r\n */\r\n cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, tx1, ty1, a2, 1);\r\n cdDrawCurve(kage, polygons, tx1, ty1, x4, y4, tx2, ty2, 1, 0);\r\n }\r\n else{\r\n /*\r\n\t\t\t\tcdDrawCurve(x1, y1, x2, y2, (x2 + x3) / 2, (y2 + y3) / 2, a2, 1);\r\n\t\t\t\tcdDrawCurve((x2 + x3) / 2, (y2 + y3) / 2, x3, y3, x4, y4, 1, a3);\r\n */\r\n cdDrawBezier(kage, polygons, x1, y1, x2, y2, x3, y3, x4, y4, a2, a3);\r\n }\r\n break;\r\n case 7:\r\n cdDrawLine(kage, polygons, x1, y1, x2, y2, a2, 1);\r\n cdDrawCurve(kage, polygons, x2, y2, x3, y3, x4, y4, 1, a3);\r\n break;\r\n case 9: // may not be exist\r\n //kageCanvas[y1][x1] = 0;\r\n //kageCanvas[y2][x2] = 0;\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n}function Polygon(number){\r\n // resolution : 0.1\r\n \r\n // method\r\n function push(x, y, off){ // void\r\n var temp = new Object();\r\n temp.x = Math.floor(x*10)/10;\r\n temp.y = Math.floor(y*10)/10;\r\n if(off != 1){\r\n off = 0;\r\n }\r\n temp.off = off;\r\n this.array.push(temp);\r\n }\r\n Polygon.prototype.push = push;\r\n \r\n function set(index, x, y, off){ // void\r\n this.array[index].x = Math.floor(x*10)/10;\r\n this.array[index].y = Math.floor(y*10)/10;\r\n if(off != 1){\r\n off = 0;\r\n }\r\n this.array[index].off = off;\r\n }\r\n Polygon.prototype.set = set;\r\n \r\n function reverse(){ // void\r\n this.array.reverse();\r\n }\r\n Polygon.prototype.reverse = reverse;\r\n \r\n function concat(poly){ // void\r\n this.array = this.array.concat(poly.array);\r\n }\r\n Polygon.prototype.concat = concat;\r\n\t\r\n function shift(){ // void\r\n this.array.shift();\r\n }\r\n Polygon.prototype.shift = shift;\r\n\t\r\n function unshift(x, y, off){ // void\r\n var temp = new Object();\r\n temp.x = Math.floor(x*10)/10;\r\n temp.y = Math.floor(y*10)/10;\r\n if(off != 1){\r\n off = 0;\r\n }\r\n temp.off = off;\r\n this.array.unshift(temp);\r\n }\r\n Polygon.prototype.unshift = unshift;\r\n\t\r\n // property\r\n this.array = new Array();\r\n \r\n // initialize\r\n if(number){\r\n for(var i = 0; i < number; i++){\r\n this.push(0, 0, 0);\r\n }\r\n }\r\n \r\n return this;\r\n}function Polygons(){\r\n // method\r\n \tfunction clear(){ // void\r\n this.array = new Array();\r\n }\r\n Polygons.prototype.clear = clear;\r\n\t\r\n function push(polygon){ // void\r\n // only a simple check\r\n var minx = 200;\r\n var maxx = 0;\r\n var miny = 200;\r\n var maxy = 0;\r\n var error = 0;\r\n for(var i = 0; i < polygon.array.length; i++){\r\n if(polygon.array[i].x < minx){\r\n minx = polygon.array[i].x;\r\n }\r\n if(polygon.array[i].x > maxx){\r\n maxx = polygon.array[i].x;\r\n }\r\n if(polygon.array[i].y < miny){\r\n miny = polygon.array[i].y;\r\n }\r\n if(polygon.array[i].y > maxy){\r\n maxy = polygon.array[i].y;\r\n }\r\n if(isNaN(polygon.array[i].x) || isNaN(polygon.array[i].y)){\r\n error++;\r\n }\r\n }\r\n if(error == 0 && minx != maxx && miny != maxy && polygon.array.length >= 3){\r\n var newArray = new Array();\r\n newArray.push(polygon.array.shift());\r\n while(polygon.array.length != 0){\r\n var temp = polygon.array.shift();\r\n //if(newArray[newArray.length - 1].x != temp.x ||\r\n // newArray[newArray.length - 1].y != temp.y){\r\n newArray.push(temp);\r\n //}\r\n }\r\n if(newArray.length >= 3){\r\n polygon.array = newArray;\r\n this.array.push(polygon);\r\n }\r\n }\r\n }\r\n Polygons.prototype.push = push;\r\n \r\n function generateSVG(curve){ // string\r\n var buffer = \"\";\r\n buffer += \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" version=\\\"1.1\\\" baseProfile=\\\"full\\\" viewBox=\\\"0 0 200 200\\\" width=\\\"200\\\" height=\\\"200\\\">\\n\";\r\n if(curve){\r\n for(var i = 0; i < this.array.length; i++){\r\n var mode = \"L\";\r\n buffer += \"<path d=\\\"M \";\r\n buffer += this.array[i].array[0].x + \",\" + this.array[i].array[0].y + \" \";\r\n for(var j = 1; j < this.array[i].array.length; j++){\r\n if(this.array[i].array[j].off == 1){\r\n buffer += \"Q \";\r\n mode = \"Q\";\r\n } else if(mode == \"Q\" && this.array[i].array[j - 1].off != 1){\r\n buffer += \"L \";\r\n } else if(mode == \"L\" && j == 1){\r\n buffer += \"L \";\r\n }\r\n buffer += this.array[i].array[j].x + \",\" + this.array[i].array[j].y + \" \";\r\n }\r\n buffer += \"Z\\\" fill=\\\"black\\\" />\\n\";\r\n }\r\n buffer += \"</svg>\\n\";\r\n } else {\r\n buffer += \"<g fill=\\\"black\\\">\\n\";\r\n for(var i = 0; i < this.array.length; i++){\r\n buffer += \"<polygon points=\\\"\";\r\n for(var j = 0; j < this.array[i].array.length; j++){\r\n buffer += this.array[i].array[j].x + \",\" + this.array[i].array[j].y + \" \";\r\n }\r\n buffer += \"\\\" />\\n\";\r\n }\r\n buffer += \"</g>\\n\";\r\n buffer += \"</svg>\\n\";\r\n }\r\n return buffer;\r\n }\r\n Polygons.prototype.generateSVG = generateSVG;\r\n \r\n function generateEPS(){ // string\r\n var buffer = \"\";\r\n buffer += \"%!PS-Adobe-3.0 EPSF-3.0\\n\";\r\n buffer += \"%%BoundingBox: 0 -208 1024 816\\n\";\r\n buffer += \"%%Pages: 0\\n\";\r\n buffer += \"%%Title: Kanji glyph\\n\";\r\n buffer += \"%%Creator: GlyphWiki powered by KAGE system\\n\";\r\n buffer += \"%%CreationDate: \" + new Date() + \"\\n\";\r\n buffer += \"%%EndComments\\n\";\r\n buffer += \"%%EndProlog\\n\";\r\n \r\n for(var i = 0; i < this.array.length; i++){\r\n for(var j = 0; j < this.array[i].array.length; j++){\r\n buffer += (this.array[i].array[j].x * 5) + \" \" + (1000 - this.array[i].array[j].y * 5 - 200) + \" \";\r\n if(j == 0){\r\n buffer += \"newpath\\nmoveto\\n\";\r\n } else {\r\n buffer += \"lineto\\n\";\r\n }\r\n }\r\n buffer += \"closepath\\nfill\\n\";\r\n }\r\n buffer += \"%%EOF\\n\";\r\n return buffer;\r\n }\r\n Polygons.prototype.generateEPS = generateEPS;\r\n \r\n // property\r\n this.array = new Array();\r\n \r\n return this;\r\n}\nmodule.exports={Kage:Kage,Polygons:Polygons}",
"module.exports=require(\"./strokecount\");",
"var strokestr=require(\"./strokestr\");\r\n\r\nvar unpackrle=function(s) {\r\n\tvar prev='';\r\n\tvar output=\"\";\r\n\tfor (var i=0;i<s.length;i++) {\r\n\t\tvar ch=s.charCodeAt(i);\r\n\t\tif (ch>0x63) {\r\n\t\t\trepeat=ch-0x63;\r\n\t\t\tfor (var j=0;j<repeat;j++) output+=prev;\r\n\t\t} else {\r\n\t\t\tprev=s[i];\r\n\t\t\toutput+=prev;\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn output;\r\n}\r\nvar bmpstroke=unpackrle(strokestr.bmpRLE); bmpRLE=null;\r\nvar surstroke=unpackrle(strokestr.surRLE); surRLE=null;\r\n\r\n/*\r\nTODO SINICA Parts stroke count\r\n*/\r\nvar sinicaeudc ={};\r\nvar getutf32 = function (ch) {\r\n\tvar ic = ch.charCodeAt(0);\r\n\tvar c = 1; // default BMP one widechar\r\n\tif (ic >= 0xd800 && ic <= 0xdcff) {\r\n\t var ic2 = ch.charCodeAt(1);\r\n\t ic = 0x10000 + ((ic & 0x3ff) * 1024) + (ic2 & 0x3ff);\r\n\t c++; // surrogate pair\r\n\t}\r\n\treturn ic;\r\n };\r\n\r\n\r\nvar strokecount=function(ch) {\r\n\tcode=parseInt(ch);\r\n\tif ( isNaN(code)) {\r\n\t\tvar code=getutf32(ch);\r\n\t}\r\n\t\r\n\tif (code>=0x20000 && code<=0x2B81F) { //up to extension D\r\n\t\treturn surstroke.charCodeAt(code-0x20000)-0x23 || 0;\r\n\t} else if (code<0x20000) {\r\n\t\treturn bmpstroke.charCodeAt(code-0x3400)-0x23 || 0;\r\n\t}\r\n\t//} else {\r\n\t//\treturn eudc(ch) || 0 ;\r\n\t//}\r\n};\r\n\r\nmodule.exports=strokecount;",
"module.exports={bmpRLE:\"())&&%)&&&''(((())))))***+++,,,,,.../36'++))*+04(((((((()))))))))********++++++++++++++,,,,,,,,,,,,-.---------.....////////0000000111111111111111222222223333445566677788:=)+-.5(()*****,7+../09'',/2'))*+++++,,---.//01.)((())**++++++,,,,,-----....../////00111111111111233344567()))**+++,---./144445./0'+.8**.0001=*/'))0+&&*+)))***++,---/01124;'-..2'')*+,/11((()))**************+++++++++,,,,,,,,,,,,,,,----------------.......................////////////////////////////00000000000000001111111111111112222222222333333333344445555555666778889::<=(()++,-17(**********+++++,,,,,,,,,--------.......///////////0000000111111122222222233333334444555667;</2,,,(+/115()))**++++++,,.../03())))))*******++++++++++++++++++,,,,,,,,,,,-------------------*----.........///////////////////////000000000000000011111111111111222222333334455666677789==)**+,--/023<'(())****+,,,,----.......//00000111122258=(*+-/-/12)*++,,-....//00())*+++,,,,,-..//111226'*(((())))))))*********+++++++++++,,,----------------...............//////////00000000011111111111122222222222233333334444455566667889?)'--/2(+.(()))******++++,,,,,,--......////////00000111122333447799//13)))**++++++++,,,,,,,-----.....////01111222333367)+123*,0'))))**++++,,,,,,--...///0001228+3)*+++.//123()**++,,,,,,,,--....../////01112233467())*))*++**+******+,,++++++++,+,,,,,,--,,-,,,,,---,,.-.-.--.----,.--.../....../../.././/...//.../////////00/0/0///00010010001111011112122121111222322222223223435545554557766677799>**+++,---./01224*++,,((()))*********++++++,++++++++,,,,,,,,,,,--,,,--.-----.............././//00///////////00000000000000000000111111111111112211111122222222222222234333333444444555555555555667778888:::<<+--./**++,,,,---.....////////////00000111122233335578*-0))+,-./24:,,--/12)+-,---.../22))******+++,,,,,,,,,,----------......////////////000000000000111122222233333333344455555566799:<)34+--..//1122234)*****++++++++++,,,,,,,----------------.............././//////////////////0000000000000000000000000111111111111111111111111112222222222222222223223333333333333233333333344444444444445555555666666666667777777777788799::::**++++,,,,,,-----..../////-/00000011122334444679:<)**,,,//15)++++,,,-..//////00000111122333477:*+--.///0133345,)+++++,-.......////0000011111133333556=-+.23'(()()*)***********+++++++++++,,,,,,,,,.,,,,-------.--------......../.......././.......//////////////////////0000000000000000000000011111111111111222222222222223222233333333333433333344444444444444555555566666666777777888889899:::;;=))***+++++,,,,,,,,------.........////////////00000000000000000111111111111222222223333333333344444455667677789::=++.1,-.0+,/++---1458'-)**+++++,,,,,----........///100001112222233344455689+****++++++++++,,,,,,--------........//////00000001111112222223334445667777;))))****+,+++++,-,,,,,,----------........//////0/////0000000000111122222222223333443345444566667:,,--../111225=*++,,-----......////00000001111112223333444444455669;<-0124/23***,,,--..//00001222345567:0**++++,,,,,,-------------.........///////////////0000000011111111111122222222222233333334455555566678889:;;?*,-..0112368<+,,--../001122357+,,---../001334689@**+++++,,,,,,,,,,--------........//////////////////00000000011111111111112222222222233333333344444444455555557777889::<A+,.14447;---./01)*++,,,,,----------.......///////0000000000000000011111111122222223333333434444444455555556777888899;=*,,,,---...////00000000111112233333455678@**++++++,,,,,,,,----................./////////000000000000111111111111222222222223333333444555555577888899A*+,,,,---......./////0000112223333334444444556679)++,,----.//00003456,-------.........//////////////00000000000011111111111112222222222222222222222222222333333333333334444444444444444555555565555555555566666666567888888889999::::;=>A,--....//////000000111111222222233444444455555556667789::<<+,,,,--------------.............//////////0000000011111111111122222222222222222233333334444444444555555666666677777889999:;;;;<<>,.-.//012236,-....../113:(+,,,,---.//00011334568;---....///0111112334559--.......////0000111113355578,///,,-,.00111112244458*--../00111112233344445790))**+-++++++++++++,,,,,,,,---------............./////////////////0000000000000001111131111111112222222222333333333444455556667788889.5,0-.123--.2138+,,,--..../////001111111122233344444445557,.33559)+++,,,,,------------..........//////////////////000000000000000000010111111111111111111111112222222222222233333333333333333344444444444444444444444444444445555555555555555555555556666666666666777777777777888888889999999999999:::::;;;<<<=>>?@@@AAF+,----..//00000234556*,,,---........./////////000000000111111111111222222222212333333334444444444444444555556666666677777788899999:::<?,-.012-/337++,,,---......///////0000111111111111111122222222222333333444444444455555566777789::;;<>,-.//--...////001122333344455666668=B.000122222333344566776<,,,--.................////////////////000000000111111111111222222222222222233333444445555555566666667777777888888999:.02445:,-//12459+./01112333334448<-../02223356689<<....//12234556666..///////000111222222222233333445679:02233-0118---....////////0000001111111122222233334444555555677778999:;<,,--........///////////////000000111111112122222222222222233333333334444444555556666677889::;<?/////0000234467:,,,-.........////00000111122223333344444455555556666788899;=>B-.,2701277**++++,,-------.../////01111222233334556;()***+++,,0,,,,,-----11......///0004011111222234::,,--.....///0//00000011222233333333344445666668899;;?.-.////000111111122222222333344444455555555555666666666666777777777888888888899999999::::::;;;<@///000125777?.0016..////000111111122223333333334444444678889124(()**-**+++,,,,,-------.......///00000011112223323444678-..///000012233344567779<C.//011111111222333344444445555556666677999::;<>GW9../270001113347889;///0000001111112333333334444444555555566666677788888899::;<<==>01111345556689:0246678:///01335669//000111111111222233333333444444444555555555566666666667777888888999;;<./000011111122333334444445555555666778:;45.///00000111111111122222223333333444445555555566666777888889999::::;==>?822561444>/001111111122222223333333344444555555555666666677777778888888899999:::;;;<=>?@E347./1122222333333444444556666789:;</0169<//11111122334444555555566667777889;;;;<<=@7811239<122335555667999:;;E/01112222222233333333333444445555555555666666666666666666777777777788888888899999999999:::::::;;;;;;<<<=>>O2337788801111112222222222222333333333333333333444444444455555555666666666777777777778888889999999:::::::::;;;;;<<=>BEF244678;258:<12223335689;;11122333345556666688899:;9<27735678:;2337778889:<0124344555566777888:;<<<=569;3;;55568345689::556778>A445667778899::;;;<<==>?@@F97767888<>##########################################################################$%%%%%%&&&&&&'&'''''(((((((((()))))***++$%&&&''''(*+,-$%&''((*,$$$%%%&&&&&&&'(('())))*+,-$$$%%&&&&'''''()))))))))**++++++,,,,-.../000$%&')*+%&&&&''''''()))+*+++%&''))))***++,,,,,,-//0039%%&&&&''''''''''''''''''''((((((((((((((((('(((((((())))))))))))())))))))))))))))()))))))))))))))))))))))))))))))))***************)***************+*********************)*)****+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,+,,,,,,,,,,,,----------------------------------------------------------------------------------...........-.........-..............-../........................./////.//////////////////////.///////.///00000000/0000000000000000/00/0001000101111111110111111111111111111111111111221222222222122221222222222333333333223333444434444444345554546657888898:;%&'''())))))*******+++*+,,,--...//0137%&')+,%''''())))*+++,-,-.0035%''''''(((()(*+,,--.%''(())*+,,-------.12%(((()))))*******+++++,,,-----------.../////012222334%&&&'((())))*+++.//11%'((((()+,/%%%&&''''((((())))))))))))))******************+++++++++++++++++++++,,,+,,,,,,,,,,,----------------------./....-..././/.0000000001111122222222222233334688::%&''(((())))))************+++++++++++,,,,,,+,,,,,------.......-./////0000010001111122212343466%&''''''''((((()*+++,-../..2%'(..%(((())))***+,,,--...011123467%''*+,.-.%&&&''''(()('))'++++++,,./8%''((((**+++-%&&'(((()****++,++,,,.-00%''''((())))****++++,,,,,,----..../////.0/111012136A%'''((())*+++../12%&&''''((()*+++++,,,,,-,035&((((((((((((((((((((((((((()))))))))))))))))))))))))********************************)************************************+++++++++++++++++++,+,++++++++++++++++++++++++++++++++*++++++++++*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,+,,,,,,,,,,,,,,,,,+,,,,,,,,,,,,,,,,,----------,---------------------------------,----------------------------...........-.....................-............../........./......................///////////////////0...//////////////////////////////./////..////////0000000000000000/00/000//000000//00/00000000000000000/0000011011111111/111111111111111111111111102111111110222223222232222222222222222222212222222122222222222233232333323333333333332223333334444443343444444444444455555555545555555666666666466777677777787777888889898999989::;:;<<?&((((()))))))******************+++++++++,,------...../////0000011112339=&''(((((()))))))))))))))))))***)**********************************++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---,-----------,--------,,------------.............,............................................///////.////////////////////-//.///////0///////////0/000000000/0000000000//00000/000000/00001011111110111121111111111111011110111111111221222222222222111222221220122333333333333333333444443444445466656666677779:;<&'()*****,,-..///010213&'()*+,,&*+,--15668&((()))++-../01112&&'''''((((((())))))))******+++*+++,+++,,,,,,+,,----.....//.///000112123359:&((())))))))))))))))))***********************************++++++++++++++++++++++*++++++**+++++++*++,*+,,,,,,,,,,,,,,,,,,,,-,,,,,,,,,,,,,,,,,,,,,,,,,,,,----,---------,----,--------------,.---,----..........--........................,........./..............-..../////.///////////////././0/////.////////////////.////////000000/00000000/00/00/000000000.000001111111111011111111111011101111222121222222222220222222222233333333233333233334444433444444444334445645566677777778879999;:&&&&'())))*****+++++++++,,,---..././010133446679&(((()))))*********+++++++++++++++,,,,,-,,,,,------------------...........////////////0000000001111111111222122234466678&()))***+,,---,...///12&''(((()))++,,,/001&'')*)*+***+,,//0/0244&''(()******+++++++,,,,,----------....//./11222245568;&')&'((((())))))))))))*******))****************+++*+++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---,------------,-------------.....-...................................../////////////////////////0///////////////////0000000000000//00/000/0001121111111111101111111112112222222222221222222233333333323223233444443444545666677778679789999999:;:&%&))*)..2&(('))*,,,/1&&&'*+,-,,,-/&'''(((()))********++++++++++++,,,,,,,,,,,------,---..........././//////////0000000111101110112222222122333234445367&()))++0&'(,/&(((()))**************++++++,++++,,,,,,,------,--,............/../////0/000./0011/1001011112212222221233333356677789<%())**+++,&''()***+,,-1&'()))/0&'''(())))*****+++++++++,-,,,----....../////0000011132133449:&&()++,./0033556<&***,,--..../01129&)))*****+++++++++,,,,,,,,,------,-..../....../...///////00000121121222233446778'&('()(()***)***))))**)))*++*+*+)*+***+***********+*******+*+*++*****++++++,+++,+++++,++++,++,++,,,++,++++++++,+++++,,,+,,+++,-,,,,,,,,,-,,,--,,,,--,,--,,-,,,,,-,-,-,-,,,-,-,,,-----,,,,,,,.------.--..-----.-------.-------..-...--.-...---..//../../......./../..../.././..//.../.........////./...///....///0///0/////////00///0/0////0/0///////0/000///0/////.//1000100000/1000010/1000101100/010001/000101101121211211101112022/0121221211111212211212211222212123232212322223323221322322223222322222222323433333332333324333434243332343335545344343544454444445554565465556677768789::9::<<?'((()))))***++++,-....///0/0000111111222334549'''(***++++,,,----.//'&&'(((((((())))))))))))))))))))))****)*************+**************************************++++++++++++++++++*++++++++++++++++++++++,++*+++++++++,++*++++++++++,,,,,,,,--,,,,,,,,,,,-,,,,,,,,-,,,,,,,-,,,,,,,,---,,,,,,,,,,,,--,-------.----,--,,-----------------------,-------,---------......................................./......./............../............//...........././////0/////////.////////////////////-//0///0/////0///..///////////////00000000000/0//0000000/00000000/0000010/00/000100000010/01000000000000111111/01111101011111/1111112211111221111111011111212112122123222222222222112222222222222212222222212122220222223313333333133343333232233223433233344444454444544344444345555555555464545556666666666667777777688899989:9:99::::;;<'),/3''))*****++,,,,,,,-------.........-....././///.////////0/00001113212222233334444677'*+--/...//0358;'*--..//01124'(++++,,..//0/123445<'+++,,,,------...-.....//00/01133456656'',./'(())))))))*********++++++++++++*++++++++++++++++++++,+,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----------------------........--........///////////////0///////////0000000000//0/0000000010111111111111122222112122222232332333332211333333334244443444544556565667777778:::;:<'())**+,-.--../////01138')++++,,,,----.-..../////0133347''((((((()))))))))))))))))))**************************************+++++++++++++++++++++++*++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,-,,,,,,,,,,,+,,,,,,,,,,,,,,,,,,+,,,,-,,,,,,,,,,,,,,,,,,-,,,,+,,,,,,,,,,,,,,,,,,,,,,,,-------------------------------------------------------------,--,-----------,------------........................-..-....................-.-..-...................-..............///////////////////////////////////-//0/////////////////.////////////////////////////.//.///////////////////0/0000000000000000000000/0/000000000000./000/00000000000/000000/0/0000/000000000000000000000001111111/111001111111111111111111111111010111111110111111101111101010111111111111111112212221022222212222222222222222221121122212222222222222222222221221122322222222233333333133333333323333333333333333332334333333223323333333333333333333333334444434443444444344444443443424344344434433445455555554555555555555555554555566656665656656554666665646666777675777767767977888787887888999989889::::;;:<;<<<<=<??'))+*+++,,,.------..-....///////0000/00001111122222223343334445468'()*++++,+--//100012235'()*+++++,,,,,,---,........////////01101122222333334445668'+,,-..-.///00001122335:''()**+,1'),,,-4'**++,,---------....////////000000/1221233333444469='(()+'()))**+++,,,,,-------../////001'&(((((())((((*((()((())))))))))))*)))))))*))))))*******+*****)****)********+*********+********+***,*****+*************++++,+++++++++++++++++++++++++,++++++*+++++++++,*++++++++*+++++++++++-+*+,,,++++++++,,,,,,,,,,,,,,-,,,,,,,,-,,,,,-,,,,,,,,,,,,,,,,,,-*,,,,,,,,,,,,,,,,-,,,+-,,,,,,,,,,,,,,,--------------------------------------------------------,,--------------------------.........................................-................................./....../-/.........................//./////./////.///////.//////..//////////////////////////////.//////////////////////0///////.////////////////////////0000000000000/000/0/00000000000/00000/00000000000/00/000000000/00100/000200000000/0000000000000101111111101111111112111111111111111212011111111111101101121011110111111111011111212121011111111111222122222223222322212222221222222222112222222222242232222212222222222202222122233333333333432333333323333333233233333132323334223233344334443444444444444334443444446444534545554545535545555554555555666666666466456665666766666777677777777777777788878888878=8899:98999::::;;;;:<<=>=>>BC''())))))*************++++++++++++++++++++++++++++++,,,,,,,,,,,,,+,,,,,,,,,,,,,,,,,,,,,,,----------+--------------------------------......--....-......................-......//////////////////./////////////////////000000000000000//00010000/100000/000000000000/00/00000001011111111111111111101111111111111222222212212222221222222222333333243231333333333333333333333333333333344434434434444444444344555555555565566566675667767776757888989899:;;<<?AD''++,,,-/124')+-/',.1'+,-0124'+,,///00000112226'/'')))*****++++++++,,,,,,,,,-----....././/////////0/0000111111222233334566666778<>'&((()))))*))*******+********+,++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,------------,----../....//...-./.............../////.//..//0////////0//0000/0/001100/00021120111011222112222221232323333333444434355466677779999:(,-..(('(())))**********++++++++++++++++++++++,,,,,,,,-,-,,,,+,,,,,,,,,,,,,,,,---------------------------------..../.-...-............-.........//////////0/////-//0///////////////.//////00000000000000000000000000/00/0000111110111211211/0110101111222223222122221122212343313324333423333233334544444344443444565575565554466666665575777778898989:;(+--.0369;'***+++++++,+,,,--...../////0000011122212333344457(+,..00(,-..///1(()**,,/(((((()****+*+++++++++,,,,,,,,,,,,,,-------------.-.......//////.////0000001112233344566779(+-//11(*****++++++++++,,,,,,,,,,,,,,-----.----,---------------............./////////////////////000000000000000000/0000000011111111000110111112222212221211121223333333333333333233334434444442444455555555545555556666657788888998::;;=?A(+,,,//())****+,,,,.---,..../////00022222333424455567789(+--.//0111123457(**+,,,,,,---------.......//./00011112333444557(*++++++,,,,,,,,,,,,,,,,,,,,,,,,-----------------------..-,----..................-..////////////////00000000000000000000000000001101111110101111111111011122222122222233333233323333234344444444443244444445555555555666556666676788789;;;<;=(,-//0<(*++,,,,..//04457(***+++++++++++,,,,,,,,,,,,,,+,,,,,,,,,,,,---------.------,--------------------..........................///./////////////.//////////00000000.000000000000000000000000000011111010111111111110111111111222222112222121221222222212232223332333333233333333334443444444434444444444454455554555555555666565656556667677767788888888999;;('()***)**+++++++++,+,,,,,,,,,-,,,,,,-,.,---.-.----.--.........///////00//////00000/0000000000001121111111224332334344555889::',,-./(*****+++++++,,,,,,,,,,,,,--------------------,,---..............///////.////////000000000000000000000001111111111111121222222222221223333341333333333344444444444555565666665677799;;()**++++,,,,,,,,--,--------.......////.///000000000010111122222223333333334344445557889(**++,,,,,,,,-------...//////000.1111134445779)++,,,,,,,,----,--------------....................-...................////////.//////////////////////0000000/000000/000000/0/0000000000011111111111111111111111111111111111111111111222222222221222222202222222232222222222333333333333333333332333333333433443434445444444444443444444434444444555555555555554555665555556665666646666666776676777777788888789999999:999:::::9:;;<;<<==AC)+++,,,,,,,,,,,,---------------..-........./////.//////////000000001111111111012222222222222333332333333444444435555556666677797=99<=))**++++,,,,,,,,,,----------------,-------------..//.................................///////////////////////////////////////////00000//00/000000000000/0000000/000001111111101111111111111111111111111111111111111111111111111222222222222122222222222222222222222132222222222223332232333233333323333333333333334334344444444443434444444444444444444555555555555555555565545555666656665666666566777677777688888788888899::::;<<<<>>@&()))))))))))*******************++++++++++++++++++,,,,,,,,,,,,,,,---------.........................///////////.///////////00000000000011111112222333336)+,----.///113444555667899:)('+*++,+,--------.///000000001110112222333244454556669;;)+*,,,-,---.-,--....-.///00000000122222335556666788),,-------............/////////0011111111222222223333443445555546677)')-+-,.,-/),,,,,)+,-----.....-/001112233344556899)*++,-----------...........///////00001111111/111222222223234434445556777699)'--+00011)())))+*****************+++++++++++++++++++++++++++++++++,,,,,,,,,,,,,+,,,,/,,,,,,,,,,,,,,,,,,,,,,,.-----------------/----------,----------/...........--.......-...............///////////////////////1//////////000000/000000000000000/00/00000000000111101101111111131222212232212222222243333333333333332324344244444444443344645555545667567777898<<:)++/144)*--///23)-/////13)++,-,.//0103347)+++-./11122356)/01)+,,,,-------------..........////0000000/001111222222232323444455566665766789:;)*+4)-./6;)&'(((((((()))))*))))))))))),)))*****)**********)******************-********************+++++++++++++++++*+*++++++++++++++++++++++++++++++++++++,++++,++++/+++,,,,+,,-,,,,,-,,,,,,,,,,,,,,,,,,,,,,,/,,*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------,------------------,-------,,-------------------------------0--.....-............/.....................-........-.........................................................////////////.//.//////////////////////////////./////////////////////////////////////////.////////2//////00000000000000000/00000000/000000000000000000/0000/000/.00000000000000000/0003000000000000001011/111111121110110112111/1111111111111111111101111111111111112010101111111111112222222222222222212222221322222222222222222222232122222233232333333233333333331333333333132333333332333333333333334443444444444344444444434444444444448554555555555455555555554565545555655666666666666666666676666666667777777776776677767777877779878878998999999;;:=:;:;;=@>)++,----....../0/001023333445=)*++++++,,,,,,,,,,,,,,,,,--------------------------------,------.-..........-........................//////0//////////////////////////////0000000000000000000000000000///000011111111111011111111111111111211101111111111110111112022222221222222222222222221222122222222222212222222221333233332333333333323333332333333333333444343444434344444444444444433444444444434565555555445555554555555555565555566666655666456565566666646777677677777886888878999989899::::::9;;;:;;<=>>>),,--.////7;),,--....///0022223333;)(*+++++++,-,-+,,,,,-,,-,,,-,,-,-,-,,.--..-----------------.-.---.-------..--../..............//.././..0////0////0///0/00/0/00/////100001000000011100010101000/0001111111111111211111110121122122222313122332332222333344443334334244444444443434344555455565555666667767777888999:99;;:;:<))),-//0566:<*,--.....././///0011111222233323444445555666567778899;')*+++,,,-.//0122*,,....-//0//0000000001111222223445567768989:<**,,,,,,,------------------....................-....//////////00//////////////.//////////////////000000000000000000000000000000000000000000111111111001111111111011111111111111222222222222222222222222222222022222222222222333333323333323333333333333323333323333344444334443344443444444444444445555444555555455555544555565654656865666667666666666666666777776777677767777777787887888887999889999::9:::::::;;;:;;<<;=<>=>@%'''''(((((((((((()))))))))))))))******************+++++++++++++++++++++++,,,,,,,,,,,,,--------------------..................../////////000001111112226*-...012444559:*--.00222457<>?*+-......///.0000011112233443445566*---..//////00000001112233324445456;>*,,,----..........///0///.///////////000000000000011111111112222222222222222222223333333344444444555555546666666767888889999::;;')))**+++++++++++++,,,,,,,,,,,,-----------....///////////00111123333448*...00013234*),,,,---........///////////0000000001111112222222222333455666788:=*,----......-.....///////////0////////////./0000000000000000000000/000000111111111111111111122222222222222222222222222222202233333332332233333332333443444444444454555555555555555455656666666666666666666666576777757688888898999999::9::;;;:<<<;<==?>=*-.../00011222222233555666678;>*+,,--------............../////////0////////////////00000000000000011111111122222222222222222222222333333333333333344444444455555456666666667777788788999::='()***+++++,,,,,,,,,,,--------...////////000000111233*//000111233333345678*-026*&'(((((())))))))))))**********************++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,-----------------------------...................././///////////////./////////00/000000000001101111111112022222222233332343324445556899*''(-(((((((())))))))))))).)**********)****++++++++++++++++0+++++0+++,,+,,,,,,,,,,,,,,,---------+----2--.3..-..-...........////////////00/0000000000011511111111112222223344444565667788*,,-------............////////0000000000011111111111111222222222222233233333333433333444444455545555666667777777888:;;;;=;===*+.//7*,./5++,,--------------........................../////////////////////.//////////////////////////100000000000000000000000/00000000000000000000000000000000000000000/00000111111111111111111111111110111111111111111111111111111111111122222222222222212222222221122222222222222222222221222221222212222222233333333333333333333333333322333333133333333333333333333333333233332333333333333434434444444444444444444444434444434444444444434444344444434444444555555555555555554554555455555555455553555555555445554566666566565656566666666666666666566666666666666666678577777778777777666777676777777777777777777777777777778787868888888786887788889999999889999999989:9::::9:8:::::::::9;;;;;<;<<<<<=<<====>>>>????@?())*****+++++++++++,,,,,,,,,,,,,,,,,,,,,,,,-------------------------------.........................................//////////////////////////////0000000000000000000000000000101111111111111111112222222222222222333333333334444444444455555567799+*-./268'+,,---...../////////////00000000011111111112211212222333333333334334444444444344555555555666666777888789&'()))))********++,,,,,,,,,----........../////000013+%''((((())))))))))))))))))*******************++++++++++++,,,,-,,,,,,,,,,,,,,,-----------------.-....................//////.//0000/00011112111213333333456+34+-----..////////00/1000111233454545555556568;;?+..././/////00000000000111222212222333333333333343444444445555656566667777867788888899988:;;;;:;;<=>>>>@J++//001112335+/26,+1238:,.///////000000/0111111111111122222222222233332334444444455555555554555566566666677886899989:;;:<@,/11222344455555666566689:;'*,/001,/2346,0011354667779,...////000000000001111111222222222332222222333332333333333335544444444444555555555556666666567777788888999:9::;<<>=)++,,,,---------....///////00000001222222333355678:,//001111122334455565656677778888889=>'*,,,/0011233,8>&,+.---../////0/0//0/000001020000001111111211212113222222222333233333334333344445444443444455554545545665656777777777799878788:;<<>>A&(())*******++++++,,,,,,,,------..../////000001122<,.4,0111333444556578:>-//0000000111101111111111111222222212222222222222222233333333333333333334444444444444444555555555555555566666666656666666665666776777767777678888888778888789879:999999999::::9::;;;====>=>>?>@A&()))****++++++++++++,,,,,,,,,------......./////000011124677,./////00011211122222332445555666656677789889::<-.1259:-/0011111111223222222233333334444444555535666666677777788899999:::;;<>-123578<;>->@-345567889,/0000011112334444446676787:::.00001111221222222222222222222223333333333334333333333333323333444444444434444444444444444455555455555555554554555554555556665666666666666666666666666666666777767757777777777777777677777777776778888788888788888888878899998999999997898999999:99:::;9::::::::::9:;;;;;;;;;;<;:;<<;;;<==<=<>>?AD+-./////0000000000000111111111111111222222222222233333333333333344444444444444445555555666666666777788889./00000,0000111111222222222222222222232222333332333333343333333333333333444434444444444444444444444445555555555553555555555565555646666666666666666666666666666666666666666667677777777677777777776777788888888888888878887788888888888888899998999999998999:::::::89:;9::::::::9:::;;::;;;;;;;;;;;;;;<;<<;<<;==>>>????@AA(**+++,,,,,-------------........./////////00000000000011111111222222223333444455555599.236778;;3.0002233334445555566666667777889:;<?AD.*[email protected]:/.2233344;/249/.2333332444445556677777778888899:::<=>?/3460+4555668::;<=/07/11120055698889<;<0+44455555555667789999::::?13344569::;;<>G14568:)2234566677787777747888888999:::::;;;;;;<;<<??F+-./0000112244356678999CDS(..49?*489<==23-4,/38>0'(53%&'(()+6420.805/-4++**.4/\",\r\nsurRLE:\"%%%&&&&''''''((((((((((()))))))))********)**+++++++++,,,,,,,-----.....//////001111122343333343457%%'(()**++++,,,--).//112569&&''(()-03%%%%%&&&&'''''(((((((((((((()))))))))))))***++,++,,------....//102:$$$$$$%%$&&&'''''''''(((((()))))****+++++,,,,,,----.......001111467$%%%%&''')***+./23%%%'))))))***+++++,,,,,----../00012'()))))****+++++++,,,--------..........///////////00000000000110222222222233333333333333455568;?@%&&&'''((((((((((())))))))))))))))))))))))))))))))))*********************************************++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------------------------------------..........................................+.............-............./////////////////////////////////////////////////////////////.0000000000000000000000000000000000000000000000000000000000100000001111111111111111111111111111111111111111111111171111111111111111111111110122222222222222222222222221232222222222222222222223333333333333333333333333333333344444444444444444444444444455555555555555555555555566666666666666666677777777778888888788888999999::::::;<==@@'(())))******+++++++++,,,,-------.......//////0001111111112223222233333334444444545556676778899::;;;=&'''())))*****+,,,----.//000011113457&''''((&))******++,,,,,,,---..//////////0000000111133355666c&''''(((((((((()))))******+++++,,---...///0011212335579''(((()))))))****+++,,,,,-------.//////00111133455577789:&'((())))))*********+*++++++,,,,,,,,,,,,,,,,-------------............/////////00000000001111112222222231334444444555556689=%%''''''''(((()))))))**********+++++++++,,,------......./////0000111223333478%&'''((((())))))))*****+++,,,,--..../112234678;%&''''''''(((((((()())))())))))))))))))))))*************************+++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------------.........................-........//////////////////////////////////////00000000000000000000000000000111111111111111111111111111111211111222222222222222222223333333333333333334444444444444445555556667877778888:;==&'''((()))))))))***************+++++++++++++,,,,,,,,,,,,,----------------..........//////////////00000000000001111111111111111222222333444444455556678::<E'(((()))****++++++,,,,,,----------.......///0000011111123333444777%'(*****+,,,,,,,-----//0111456%')))))*****++++,,,,,,,,,,,,,-----..//////000111222222335566779=A'))***+,,-1799''(('(()))))))))))))))*******+++++++++++-------......////0000000001112222244445555568<=&()))))*****+++++++++++,,,,,,,,,,-----.-....../////011222>D''''())))))*,,,,,-///000145555='((((((())))))))))))**********+++++++++++++,,,,,,,,,,,,,,,,-----------------.......0.......//////////00000000111111111111111111112222222222222333334555555577889:::;@CD&&&&''((((())))))))***+++++++,,,,,,,,,----..///////00000001111223644466'''''''(((((((())))))))********++++++,,,,,,,,,,,-----------................//////////000000000000111111112222333333444566889:;;''''''(((((((((((())))))))))))))))))))))))))))))))*************************************************************++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------------------------------------------------.-----------------------------------------------------------------................................................................................................................................................///////////////////////////////////////////0///////////////////////////////////////////////////////////////////////////////////00000////0000000000000000000000000000000000000000000000000222000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222221222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333233333333333333333233333333333333333333334444444444444444444444444444444444444444444444444444444444444444444444444444444444555555555555555555555555555555555555555555555555555555555555555555555555555555555666666666666666656666666666666666666666666666666677777777777777777777777777777777888888888888888888888888888888888888889999999999998999999999999:::::::::;;;;;;;;;;;;;<<<<<<<<<==========>>???>B'''(((()))))))))))))********************++++++++++,,,,,,,,,,,,,,----------------............////./////////0000000000011111111111112223222233344444566777888='''((((((((())))))))))))))))********************************************+++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------------------------------------------------..............................................................//////////////////////////////////////////////////////////////////////////000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333444444444444444444444444444444444444444555555555555555565555555555555556666666666666666666666777777777778888887889888888899999999:::::;;;;;;;=@AGJ()**+,,,-------....//0/00001011112233344445555556677999&(())***-..0))**++++-....../00001111223334555567:A((()))***+++,,-----------........./////////0/000001111111112223333444556688=6B'''((((((('))))))))******************++++++++++++++++++++++,,,,,,,,,,,,,,,,-----------------------...................////////////////////000000000000000001111111111122222222222222233333333344444444566678899:::;;>'((((((())))))))))))))*****************************+++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------------------------------------------------..............................................................////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000002121111111111/11111111111111211111111111111111111111111112222222222222222222222222222222222222222222222222222222222222223223333333333333333333333333333333333333333333333333333444444444444444444444444444444444444455555555555555555556666666666666666677777777778888886889999999999:::;;;;;;<<<>>>>D&'((((()))********+++++++++++++,,,,,,,,,,,,,------......../////////////00000000000000111111222222233333333333455566667777779>'((())))))))))))))***********+++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,----------------------------------...........................//////////////////////////////////00000000000000000000000000001111111111111111111111111111111111112222222222222222222222222222222333333333333333333344444444444445555555555555566666666666777778888888899999999:;>;;<?<<<===>>@G')++++++++,,,,,,-.....//////000011111122222223334445678&''(())))********+++++,,,,,,,,,,---------.................//////////0000001111111122222222223333444555556668C&&'((((((())))***********++++++++,,,,,,-----------......//////////000000001111122222233333448899<<&((((()))))))))))(*********++++++++++++++,,,,,,,,,,,,,,,,,,,,,,------------------------..........................////////////////////////0000000000000000000000001111111111112222222222222223333333334455666667777888999;<<&())))))*****+++,,,,,,,------..///////002222589'''(((((((((((((()))))))))))))))))))))************************************************++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------------------------------------------------------------.........................................................................................////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222233333333333343333333333333333334444444444444444444444444444444444444455555555555555555555556666666656666666666666777777777777748888888888899999999999::;;;;;;;;;<<<>>?>>C&'&)))))***++++++,,,,,--.../123334566799;>@'''''(((())***+,--.//0022223456888'(()++,,,----...../////02234357((())))))))))))))))**********************+++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----------------------------..............................///////////////////////////////000000000000000000000111111111111111111112222222222222222222222222233333333333333333344444444445555666666666667778889999:;;;;>>(***++++,,,,,----.///0001111233335678:'''(((()****++++,,-,----.../011112222459))))))))))))***************+++++++++++++++++++++,,,,,,,,,,,,,,,,,,--------------------------......................................../////////////////////////////////0//0000000000000000000000111111111111111111111111222222222222222222222333333333333333444444444444444455555555555556666666666666777777777888899999:::::;=>>?'(((*)**+,,,,,,--.../&'(()))*,******+,+++++,,,,,,,,,,,-------......////////000011111121333344469>>@&''))*****++,,,,,--./00223458&&'''''''''((((((((())))))))))))***************++++++++++++++,,,,,,,,,,,,,,,,----------..................//////////00000000111111111111222222233333334444445555556666666777777788889;<?C))))*+++,,,,---....///0001111122333455556666779:=((())))**+++++,-----..........//////00000112222233334587999<''(())))**************++++++++++,,,,,,,,,,,,,,-----------------------..............................///////////////////00000000000000000000000000000111111111111111111111111011222222222222222333333333333333444444455555555566666777777889:<>&'((((((()))))))))))))))))))))))******************************************************+++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-------------------------------------------------------------------------------......................................................................................................../////////////////////////////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333344444444444444444444444444444444444444444444455555555555555555555555555555555555555555556666666666666666666666666666666666666777777777777888888888888889999999999::::::::::::;;;;;;;;==>>>??AB(())))********++++++++++++,,,,,,,,,,,,,,,,,--------.........////////////00000000000000111111211111111122222222222222222222233333333333344444556666777888(())))*****+++++++,,,,,,,,,,,,,,,--------..../////0011112223458::'''((((())))))))))))))))))))))*************************************************++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----------------------------------------------------------------------------------........................................................................................................//////////////////////////////////////////////////////////////////////////////////////0///////////////////////////////000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333333333333323333344444444444444444444444444444444444444444445555555555555555555555555555555555555555555556666666666666666666666666666666666666666667777777777777777777778777777777888888888888888888888899999999999999999999::::::::;;;;;;;;;;;;;;<<<<>>>?C)*+++++++,,,---------....///////0000011122233333444447********++++++++++++++++++++++,,,,,,,,,,,,,,,,,,------------------------------.................................//.//////////////////////////.///////000000000000000000000000000000000000/0011111111111111111111111111111111022222222222222222222222333333333333333333333333333333334444445444444444445555555555566666666777777777778888899::::::<<>>?@)*+++,,,,----......///00022222222334556788:'*+++,,----...../////0100011122244567')*+++++,,---...//////////.//00000000111112222233333334444455555666779)**+++,,,,,,,,,-------------.........////////////000000111111222333333455555567899:;<=)**,---//00023((())))))*)********************+++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------................................................//////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000001111111111111110111111111111111111111111122222222222222322222222222222222222333333333333333333333333333333333333333332344444444444444444444455555555555555555555666666666666677777777788888999999999:;;;;;<<>?G**++++,,,,,,----------....///0000011122222333344555556677;?F()*****+,,,,,,,,----....../////////////000000000111112222222233433333344444455555779:;''((()))))))))*******************++++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------------------------------------------..................................................................////////////////////////////////////////////////////////////////////////////////////////////////////////////////000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222232222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444443444444444444444444444444444444555555555555555555555555655555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666667777777777777677777777777777777777777777777888888888888888888898888888888888888888888999999999999999999999999999999::::::::::::::::::::;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<=========>>>>???@AABCCE)********++++++++++++++,,,,,,,,,,,,,,,,-------------------............../////////////////////000000000000000000000111111111111111111111122222222222222223333333344444444555566666777889889999:;<<='(())**+***+++++++++++++++++++++,,,+-------------......//////////////000020000111122222222333334444455555566899::;;''()))))))**********++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,-------------------.................///////////////////////////000000000000000000011111111122222222222222223333333333344444445555555566777889:::+++,,,---..............///////000000000000001111111122222333333333333333334444555555556666667788::::;;;<>>')*++++,-....011133469**++++---..0111123346779>')))))********+++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------------.......................////////////////////////////////0000000000000000000000000000011111111111111111111111111111122222222222222222222233333333333333333344444444444444445555555555555555566666677777888889999:::==?++,,,,....013455))**+++,,,,,-/.//00012244588&'''((((((((((())))))))))))))************************************++++++++++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----------------------------------------------------------------------------------------...................................................................................................-.................................//////////////.//////////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111112111111111111111111111111111111111111211111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222322222222222222222222224222233333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444444444444444454455555555555555555555555555555555555555555555555555555555555565556555555555555555556666666666666666666666666666666666666666666666666666677777777777777777777777777777777777777888888888888888888888888888888888888888899999999999999999999::::::::::::::::::::::;;;;;;;;;<<<<<<<=======>>>>>??@ADF())))))))))****************+++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------------------------------------------------------.............................................................////////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000000000000000000000000.000000000000000000011111111111111111111111111111111111111111112111111111111111111111111111102222222222222222222222222322222222222222222222221222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444455555555555555555555555555555555555555555555556666666666666666666666666666666667777777777777777777777777777777777777777777777888888879888888888888888899:99999999999:::::::::::::::;;;;;<<<;<<<<==>>>>?@?AD''(****+++++++,,,,,,,,,,,,,,,----....////////00000011111222222233334444444565455666777778:::;<<**++,--.//0113(+,,--./002223'(()*+++,,,,-----.........////////000111122233333344446679:>??(***+++++,,,,,,,,,------......./////////////////000000000011111122222222222333333344444555578*+,--..////0125()))****++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,----------....................//////////////////////////////000000000000000000000000000011111111111111111111110111111111122222222222222222222222333333333333334444444444556666666777778888899999:::;;<<<?'(((((())))))))))))))********************************+++++++++++++++++++++++++++++++*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,----------,-------------------------------........................./////////////////////////0///////////////////////00000000000000000000000000000000000000000000111111111111111111111111111111111111111111222222222222222222222222222222222222222223333333333333333333333333344444444444444555555555555555556666666677778888889999::::;;;;<>(,/1')))************++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------------------------.....................................////////////////////////////////////////////////////0000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111122222222222222222222222222222222222222222222323333333333333333333333333333333333333333344444444444444444444444444444444555555555555555555555555555555666666666665666666666777777777778888888888899999:::::::;;=<<<<<=?+,,,,,-----.....///////0000002111112332222223455588899::;==A**++++,,,,,,,-----------..............///////////////0000000000001111111111101111112222222222223333333334444444404555555556677778888888999::::::;<>@(++++++,,,,-/01223345589?()+++,,,,,,,-......//////00000011123444566666899)*++-./122569<:())********++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-------------------------......................//////////////////////00000000000000000000000000111111111111222222222222222223333333333444444444444444444555556666666676777777888888999:::;<=====>>?ACDG(()+-,///002333359)*********++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------............................../////////////////////////////////////////////0000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222233333333333333333333333333333333333333444444444444444444444444444344444444444444444444444444455555555555555555555555555566666666666666666666666666677777777777777778888888888899999::::::::;;;;<<<===>?@**,,---...////0001223373))***++++++,,,,,,,,,,,,,,,,-------------......./////////////000000000000000111111111111222222233333444444455556666666667777888999::;;;;<@**++++++,,,,,,,----------........////////0///0000000000000111111111111122222223333333333344455555555566667777788999;;<=@D**+++++,,,,,,,,----------------.............-///////////0000000000001111222222222222333333333333333333444444444444444444455565555566666677777777777899999::;;;;:<<=AD))************+++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----------------------------------------................................................///////////////////////////////////////////////////////////0///0000000000000000000000000000000000/000000000000000000000011111111111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222222222222222233333333333333333332333333333333333333333333333333333344444444444444444444444444444444444444444444345555555555555555555555555555555555555556666666666666666666666666667777777777777777777888888888888899999999899999:::::::;;;;<=====>>?@)+,,------...////////00001111111111112222222233335444455566666668777:::FG**+,,,,,,,---------.....................//////////00000000000000000011111111222222222333334444444555556666:99::))******++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,---------------------------------------------.......................................................////////////////////////////////0000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111112222222222222222222222222222222333333333333333333333333333333333333444444444444444444444444444444444444444555555555555555555566666666666666666777777777777777777777778888888888899999999999999:::::::::;;;;;<====>>>??@E'())))))********++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-----------------------------.............................//////////////////////////////000000000000000000000000000000011111111111111111112222222222222222222222333333333333333333333444444444444444555555556666667777788888999999::::;;<<<==(+-.////01222448;()))****+++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------..........................///////////////////.///////00000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111112222222222222222222222222222222222222222222333333333333333333333333333333333333333333333344444444444444444444444444444444444444444455555555555555555555556555555555566666666666667666667777777777777777777777778888889999:::::::::;;;;<<<<===@@CF(****+++++++++++++,,,,,,,,,,,,,,,,,,,-------------------------....................../////////////////////////////////////0000000000000000000000000000011111111111111111111111122222222222222222222222222223333333333333333433333333333333344444444444444444444555555555466666677677877777888888888888889::;;<;;;<=@**++,,,,,,,-----------------.............////////////000000000000001111111111111222222223343344444444645555555556667777778899<:;<<)*++++,,,,,,,,,,,,,,,,,,-----------------------------............................../////////////////////.////////////////00000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444444444444444454444555555555555555555555555555555555555555555555555555555555555555555555555455555555555555555566666666666666666666666666666666666666666666666666666666666777777777777777777777777777777777777777778888888888888888888888888888888888888888888888889999999999999999999999999999999::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<========>>>>>>>?@@????@@@AABC**++++,,,,,,,,--------------....................../..///////////////////////.0000000000000000000000000000000000000011111111111111111111111111111111111111111222222222222222222222222222222222223333333333333333333333333334444444444444444444444445555555555555555555555555555555666666666666666666666666677777777888888888898899999999:::::;;;;;<<<<<=====>>ABD+++++++,,,,,,,,,,,,,------------------------------------------...................................////////////////////////////////////////////0000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222232222222222222222222222222233333333333333333333333333333333333333333333333333333333333333334333333444444444444444444444444444444444444444444444444444555555555555555555555555555555555555555555555555555555555666666666666666666666666666666666666666777777778677877877777777777777788888889888888888888888889999999999999999999:::::::::;;;;;;;;<;<<==>>>>>??@AB+,---..../////000012223344),,,---....../////0000111111111222222233333334444445555666677889:::;;=>B((*(*)(******++++++++++,,,,,,,,,,,,,----------------------------.........-......../////////000000000000/00000000000111111111111111111222222222222223333333333333333333334444444444444555555555556666666666677777788:;;;;;;;;=>???)))+++,,,,,,--------------.........-........../////////////0000000000000000011111111111222222222222233333333444444444444445555555555555555666666677777788888899::;<=>AA+*,,,,,,,,,,,,,,-------------------............../////////////////////000000000000010111111111111111112222222222222222222222223333333333323333333444444444455555555555555566356677778988778999;**+++,,,,------.0142233445::=++)+-.//0122222334449;)+++,,,-.../////0001111111111122222222233333333444444445555655555666688;;<*++++++++,,,,,--------------------................///0/////////////////00000000000000000001111111111111110111111111122222222222222222222222222333333333332333333334444444444444445555555555555555555566666666666777777788888999::;<=)+,...///00111222344467)))))))))))***********+++++++++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-------------------------------------------------------..................................................////////////////////////////////////////////////////////////////////////////////////0000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111001112222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333334444443444444444544444444344444444444444444444443455555555555555555555555555666666666666666666666666666777777777777777777788888889999999:::::::::::;;;;;<<===>?*),----..////3112124455889@B)***+,,,-----------....////01112222223334444566666777788;=))+,,,--....//0111222133333455)))*++,,+,,,--------..,.....//////00000000111111111122222222223333323334444444445555555566667767777778889::;<<<=>>AMS*,---------....////////001111111122222233334445556789::=2257:9;<>*++++++,,,,,,,------------..............////0/////////00000000000001111111111111111111222222222222222222222223333333333323333334444444444455555555555555555555555666666666777778888888999999::<<=>=A,../0247,....../00011111122222233333777<((()))))))))))******************++++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-------------------------------------------------------------------------.........................................................../..................................../...................///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222322222222222222222222222222222222222222222222222222222222222222222222222A3333333333333333333333333333333333333333333333333333333333333333353333333333333333333333333333333333333333333333333333334333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444444443444444444444444444444444444444444444444444444444444444444444555555555555555555555555555555555555555555665555555655545555555555555555555555455555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667777777777777777777777777777777777777777777777777777777777777777777777777777777776878888888888888888888888888888888888888888888888888888888888888899999999999999999999999999999999999999999::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<?<<<<============<>>>>>>>>????H@@ABNDA+,,,----............../////////000000011111111111111222222222222233333333333333333333344444444445555555655666666777776888888899::=**+++++++++,,,,,,,,,,,,,,,,,,,-----------------------------------.................................................////////////////////////////0//0/////////////////////////00000000000000000000001000000000000000000000000000000000000111111111111111111111111111011111111111111111211111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333323333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444444444444454444444444444444444555555555555555555555555555555555555555555555555555555555555555555555555556666666666666666666666666666666666666666666666666666666666677777777777777777777777777777777777777778888888888888888888888888888888888888888888899999999999999999999999999999999999999::::::::::::::::;:::::::;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<=======>>>>>>=>>>>>>???????@@@@AAAAAABBCCC+++,-----...//00000111111222212333334445555556677899:A++++,,,,,----.///////000000121122344455689(*****++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-.-------------------------------..................................////////////////////////////////////0000000000000000000000010000000000000000000111111111111111111111111111111111111111112222222222222222222222222222222222222333333333332333343333333333333333333344444444444444444444444444444444444444444444444555555555555555555555555555566666666667666666666666666777777777778777888888888888899999::::;;;;<<<<<===>@@BDDHH***+,,,---...//0011111111222333455678<++,-----..............////////////00000000000000000001111111111111111222222222222222222222233333333333333333333334444444444455555555556666667777778888999999;;;;<<<<<<=>?EHO*+,,,----......................////////////////0000000111111111111222222222222222222222223333333333333333444444434444444444445555555555566666666667777888899999::;;<=??@@**+++,-------------..............................................///////////////////////////////////////00000000000000000000000000000000000000000000000001111111111111111111111111111111111111111011111111122222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333344444444444444444444444444444444444444444444444444444444445555555555555555555555555555555555555555555566666666666666666666666666666666666666666777777777777777777777777777888888888888888988888888889999999999999999999999999999:::::::::::::;;;;;;;;;;;;<<<<<<<<=====>>>>??????@J**---....//0001122222233333344445666666667788<>B,---../////00001111222222222233333444444455555466666666777777889999:::;<<>>@+**,----.......//////////0000000000000011111111111222222222222222233333333334444444445555555666667777788889999:::9;;<<<>@G+,--........//////////////////00000000000011111111111111122222222222223333333333323334444444444445555565555566667666667777777889::;>,,,,,,---------......................//////////////////////////00000000000000000000000000000000001111111111111111111111222222222222222222222233333333333333333333433333344444444444444444455555555555555555555555555555566666666666666666666666666777777777777777788888888888999999999999::9::::::::;;;;<<===+,.///2+,,..///0001111222223333334444556666688899::::*+,,,,,,,--------------.........................//////////////////////////000000000000000000000000000000011111111111111111111111111111112222222222222221232222222233333333333333333333333333333333344444444444444444444455555555555555555555555566666666666666666666666777777777777888888889999999::::::;;<<<<<>?*++,,,,,,,-----------------................................///////////////////////////////////00000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222223323333333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444445455555555555555555555555555555555555555555555555555555555555555555555566666666666666665666666666666666666666666666666666666667777777777777777777777777777777777777777788888888888888888888888999999999999999999999::::::::::::::;;;;;;;;;;<<<<<<<<<<<<<======>>>????@@@AABH***,-----.................///////////////000000000000000011111111111122222222222222333343333333444444444445555556666666666666677777788888999::<<=,,,,,,,------------...........................//////////////////////////000000000000000000000000001111111111111111111111111111112222222222222222222222222222222222222223333333333333333333333333333333333444444444444444444444444444444444555555555555555555555555556666666666666677777777777777777777778888888889999999999999:::::::::::;;;;;;;;;;<<====>?>?=>??@ABI++,-37*+--...//00001111222233333333444444445555566666777899;@A**00023689(((()))))))))))))))))********************************+++++++++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,--------------------------------------.................................../..............///.////////////////////////////////////////////////////////////000000000000000000000000000000000000000001111111111111111111111111111111111111111111111222222222222222222222222222222232222222222222222233333333333333333333333333333333334444444444444444444444444455555555555555555555556666676666677777777777777778888888999999:::::;;<=%''((((((((((()))))))))))))))))))))))))))))****************************++++++++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,------------------------------------......../........................../////////////////////////00000000000000000000000000000000111111111111110111111111111111111111112222222222222222222222333333333333333333344444444444444444445555555555556666666777788889::::::=----......................./////////////////////////000000000000000000011111111111111111111122222222222222222222222222222333333333333333333333333333344444444444444444444444444445555555555555555555555555555666666666666666666666666677777777777777778888888899999999::::::::;;;;;<<==>>>???BB-..1112223344457889.--.////00122233445555788<A-----........///////////////////////////0000000000000000000000000000011111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444444444444444444444444444455555555555555555555555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666777777778777777777777777777777777777777777777777777777777777777777777777888888888888888888888888888888888888888888888888888888888888899999999999999999999999999999999999999:::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<=====================>>>>>>>>>>>????????<@@@@@AAABCFI++,,,----//00002123434455**,............////////////000000000000001111111222222222222333333333334444444555555556666667777788899999::;;=?@++,------.......////////////////////////////00000000000000000000000000111111111111111111111111112222222222222222222222222222222223333333333333333333333333333344444444444444444444444444455555555555555555555555555556666666666666666777777777777777777777778888888888888888898889999999:::::::;;;;;;;;;<<<<<<<;=<==>@CC)))**,,///002247%''''''(((())))))))))))))))***********************+++++++++++++++++++++++,,,,,,,,,,,,,,,,,,,,,,,,,,,,------------------------------------------..................................//////////////////////////////////////////////0000000000000000000000000000111111111111111111111111111111112222222222222222222223333333333333344444444455555555555566667777778899::==>>012222333455779---..........//////////////00000000000000000011111111111111111111111112222222222222222222223333333333333333333333333333333444444444444444444444444555555555555566666666666666667777777777777777777888888888888999999999:::::::::::;;;;;<<<===??CG,--.........////////////////0000000000000000111111111111111111111222222222222222222222222222333333333333333333333333333333333334444444445444444444444444444444444555555555555555555555554555555555555666666666666666666666666666666666677777777777777777777777777777778888888888888888888889999999999999999999:::::::::;;;;;;;;<<<<<<<<<<=========??@@@@@BCCIKS.//000013345678;<---....////////0012222357777=///0000000111111111111222222223333333333444444455555566677777788888888899:::::;;<==>>>??..////00000000000000000000000111111111111111111111111222222222222222222222222233333333333333333333334444444444444444444444444444444455555555555555555555555555555555555566666666666666666666666666666666666777777777777777777777777777778888888888888888999999999999999999:::::::::::::;;;;;;<<<<<<<========>???ACCDDEI/0000011111111111122222222222333333333444444444444455555555556666666667777777788888888999999::::;;<=>>>?@@+,,000023444566787788999::</00111122222222233333344445555666677777788899999:;>D,..../////////00000000000000000000000111111111111111111111111111111122222222222222222222222222222223333333333333333333333333333333333333333333333344444444444444444444444444444444444555555555555555555555555566666666666666666666666666777777777777777777777788888888888888888888889999999999999::::::::::::::::::;;;;;;;;<<<======>>>@@B116..////////0000000000000000001111111111111111222222222222222333333333333333333333444444444444444444444444444445555555556555555555555566666666666666666777777777778888888888888888999999:::;;;;;<<<<<==>>?FGHQS,,.///001134,012566678899B+++,+---..............///////////////////0000000000000000000000000000000001111111111111111111122222222222222222222222222222333333333333333333333333333333333333333334333333333444444444444444444444444444444444444444444445555555555555555555555555556555555556666666666666666666666666666666666667777777777777777777778777777788888888888888888888899999999999999999:::::::::;;;;;;;;;<====@AC***++,--.-..//0112,../011111222222233333334455556676789::;<>-00011112112233444555455566666677778888899:=?-.///////00000001111111121111112111111222222222222222222222222222222222333333333333333333333333333333333333333344444444444444444444444555555555555555555555555555555555555555555666666656666666666666666666666664666667777777777777777777777777777777777777777777777888888888888888888888889999999999999999999999999999::::::::::::::::::::::::;;;;;;;;;;;;<<<<<<<<<<<<<=====>>>>???????@@AABBG*+++++++,+,,,,,,,----...//////0//////000225...////////000000000000000011111111111111111222222222222333333333333334444444444444444444444555555555555555555566666666677777777777777888888888999999999999::::::;;;;;<<<<=>>?00111111111222233333334444455556677777889:::;;<==>>?B/////0000001111111111111111112222222222222222222222222222222333333333333333333333334444444444444444444444455555555555555555555555555556666666666666666666666666666777777777777777777777777788888888888888888888999999999999999999999999:::::::::::;;;;;;;;;;<<<<<<<<<<=======>>>>???BC--011123455788899:;;;?22357889:>?0011223333333344444555556666777778888889999::::::::::;;;;<<=====>>??@@AAABBCHH..../////////////00000000000000000000000111111111111111111111111122222222222222222233333333333333333333334444444444444444444555555555555555556666666666777777777777888888888888888888999:::::::::;;;;;<====>>??@BC.000000001111111111112222222222222222222222222222222223333333333333333333333333333333344444444444444444444441444444444444444444444555555555555555555555555555555555555555555666666666666666666666666666666666666666666666666666666666666666666666667777777777777777777777777777777777777777777777777778888888888888888888888888888888888888888888888888888888888889999999999999999999999999999999999999999999::::::::::::::::::::::::::::::::::::::::::;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<==================>>>>>>>>>>>>>?????????????@@@@@@@@@AAABBCCCC///111102222333324468:///000000000001111111111111111111222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333334444444444444444444444444444444444444444444444444444444455555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666677777777777777777777777777777777777777777777777777777777777777777777888888888888888888888888888888888888888888888888888999999999999999999999999999999999999999999999999999999999999999999:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<<<<<<<<<<<<======================>>>>>>>>>>>>>>>>>>>>>?????????????@@@@@@@@@AAAAAABBBBCCCDDDFGG,,,-.......//0112222711222233333345556666666777777778888899999::::;;;<<=>?00112222222222223333333333444444444444444555555555555555566666666667777777778888899999:::::::::;;;;<<<<<<<>??@BFG0000011112222222222222223333333/33333344444444444555555555555555666666666666666677777777777777788888888999999999999999::::::;;;;;;;==>>???AB-../1,2250111222222333334445566677889:::;<B0122222344444445555666666666666677777788888899999:::;;;=>B1223333334444444445567777788889::::;=<=???/01112222222233333333333333444444444444455555555566666666667777777777777777787888888888888888888888888899999999999999999:::::::::;;;;;;;;;;;;;;;;;<<<<<<<<<<<=====>>>>>>????@@AACCIL57888:12244444455555556666667777788999999999::;<<=<=>>?/1222359>33444555566666666777777888899999999:;;;;<<=>@2233344444444444455555555566666666777776777777778889999999999::::::::::;;;;;;<<<<<=>@@AB2334455555666666677778888888899::::;;;<<<<<===>>>ABC13455667798<<<?A444455566666666667777777777777777778888888888888888888888899999999999999999999999::::::::::::::::::::;;;;;;;;;;;;;;;;<<<<<<<<<<<<<<<<<=========>>>>>>>>>>>>>??????@AAAAAABBBBCCCCDEEEEFFGKK13666677778779999::<>>c385667777777777788888888::;<>>>??AD38<<<====>?BDH#########################################&&'+,-.3',%+),--()**+,--.//0*/12((*./26'))))*********++++++,,,,,,,,--------...........//////////0000011111122222333344455566678+,-02226-)/0123***+-./1())))***+,,,----...//001237)*-.0(+-/0056)))**+++,,--....///000233***++,---.//01128&),0)**,-17*-.0122457'*-1+,(*++,,,,----..//000112247,-./027'')*++,,--//013(***++++,,,,,,,,,,-----------3............//////////////000000000000001111111111111222222222333333344445555556667779;;*+,-..013(()))))***********++++++++,,,,,,,,,----------------..............////////////0000000000000000111111111112222223333333444444555567-0970)+,-./1239'()***++++++,,,---...///00011122257))*******++++,,,,,-----...........///////////000000111111111222222333334555566788:****+,.../13448***++,,,----...///////000000111112222233334555778;)../2234*+--1234/0***+,,--.000////112234669))))***++++++,,,,,,------.......//////0000111111122223333444689*,)./01459+*//133(-....///123467*../00256),**++,,------..//0011122233444568(**,-.1*+-/049)+,,-.//148<)5-24*+--..///001113455()*******+++++++,,,,,,,,----------........////////////0000000000001111111112222223333333334445555566778899:<(),,--../01333=,.29)*******+++++++,,,,,,,,,-------------...........///////////000000000000111111112222222222333444555555679:.+2+,,--.//011222233345588;*++,-///111,-1248+++,---.////012233667**+++++++,,,,,,,,,,------------....//////0000000001111112222222243333334555888;2336)*+,,-1.../000011122388;*****++++,,,,,,,,,-------------.............../////////////////000000000000000000000000111111111111111111111222222222222222233333333333333334444444444445555555666666777778888999::;;<>=+,,../00127;+-./0012334,,--./14--..///0244<11(++,,--//0125+,.01())))****++++++,,,,,,,--------------...........///////////////////000000000000000000000111111111111222222222222222222333333333334444444444455555556666667778888899::;(***+++++++,,,,,,,,,,,--------......../////////////////00000000000000111111111111111222222222333333333344444444555556677799:;<<>*,.////002244H-.+./25-../3+/*,,---/0111238*+/,,--....////0012456)+++++++,,---------....../////////////00000000000000001111111111111222222233333333334444445566677778:;+,0+,,-001229/*.000)*+,,,,----../////0001122333457884,,,,---.//011122446,,-//001128+,11,,--.//001123445689;@++,,,----...//000011112222333444446788@,/,,.012278,,,-----.....//////000000112223333334445556668:**++,,,----.....//////////0011112245;5)+,,----....///////00011111222234557,-..///000112333345:+,--.//00112223469+,------....//00000011111122222233333333444444445555566788889:;<?++,,---.....////0111122233334455566667999++,,-...///000001111111112222233333444455556666666777888999:<=>'****++,,,,------..///00111122348012236+,-...00123568+....//0222344455799,-.///00122334559--0125.//0235+-//000112333344556?01+++,,,,--...////00011111122222233334445566789:A-/015/25=01175=+00369,1224579993))**+++++,,,,,,,,---------................./////////////////000000000000000/000001111111111111111112222222222222222222223333333344444444444444445555555555555555666666677778888999:;;;==,,-//14+,,-----.......//////////[email protected]./25:,,,---...../00000001122233333344455679::.3-/01123357<<,,-0240033--..////0011122333334445555666778:;;;=?())******+++++,,,,----......////0011234,.225+.113-034,---..//011122333445699:,,./035/025./0011122233455-...///0000011122222333334445555666777788:00144567-.//1112334455678D***+,,,--.////0-122346/007')**+++,-----........///////00001111112222222344445577778())**+,,,---..//00022345557?-00111245668:/./146..../////0000001111111122222222233333333334444444455555556666677777777777888888899999::;;;<<<=>*+,,,,,---......///0000000011111222233444445568:;02,.//000002222333468<)***+,--.00114()**+++,,,--........//0000111152/15-.//00112233445667777899;;@.003618<123581122789-047;+-/11301578<013345567789;,-..////0011123480145566699:;+./044/0111124444566799)**+++,,---../////00223713467;22457789@0111135555666777779:;>)**++,,---...//00011238255/23.00123445568128?.0234480122333334444444455556666777888889999999::::::;;;;;<<=?AC...///0000-11111122233333344445667789:/2222333334444555556666666677788889:::::;<=A,,,,,------....../////0000001111111223333445645730245:6./12446277836<4291<589>/11233458:2/@###########&)*1&)(++-.0,,,.,0*+,*--),12459/13)*-3*,,---/12212)),-..,*+,/015.0,,--//+--1122234502()-.000236-.1,+.+-/12,.-2-+,0-.-.3.0*9*.222425,-./4,+1/,,-...00123724//:9)*--/6,14(//3*-.0,15*+,,--..../01126+.20-+,-+138;/046.39,2560;3?\"}\r\n",
"(function() {\n 'use strict';\n\n if (self.fetch) {\n return\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = name.toString();\n }\n if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = value.toString();\n }\n return value\n }\n\n function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var list = this.map[name]\n if (!list) {\n list = []\n this.map[name] = list\n }\n list.push(value)\n }\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n }\n\n Headers.prototype.get = function(name) {\n var values = this.map[normalizeName(name)]\n return values ? values[0] : null\n }\n\n Headers.prototype.getAll = function(name) {\n return this.map[normalizeName(name)] || []\n }\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n }\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = [normalizeValue(value)]\n }\n\n Headers.prototype.forEach = function(callback, thisArg) {\n Object.getOwnPropertyNames(this.map).forEach(function(name) {\n this.map[name].forEach(function(value) {\n callback.call(thisArg, value, name, this)\n }, this)\n }, this)\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n reader.readAsArrayBuffer(blob)\n return fileReaderReady(reader)\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader()\n reader.readAsText(blob)\n return fileReaderReady(reader)\n }\n\n var support = {\n blob: 'FileReader' in self && 'Blob' in self && (function() {\n try {\n new Blob();\n return true\n } catch(e) {\n return false\n }\n })(),\n formData: 'FormData' in self\n }\n\n function Body() {\n this.bodyUsed = false\n\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (!body) {\n this._bodyText = ''\n } else {\n throw new Error('unsupported BodyInit type')\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n } else {\n this.text = function() {\n var rejected = consumed(this)\n return rejected ? rejected : Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return (methods.indexOf(upcased) > -1) ? upcased : method\n }\n\n function Request(url, options) {\n options = options || {}\n this.url = url\n\n this.credentials = options.credentials || 'omit'\n this.headers = new Headers(options.headers)\n this.method = normalizeMethod(options.method || 'GET')\n this.mode = options.mode || null\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && options.body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(options.body)\n }\n\n function decode(body) {\n var form = new FormData()\n body.trim().split('&').forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n }\n\n function headers(xhr) {\n var head = new Headers()\n var pairs = xhr.getAllResponseHeaders().trim().split('\\n')\n pairs.forEach(function(header) {\n var split = header.trim().split(':')\n var key = split.shift().trim()\n var value = split.join(':').trim()\n head.append(key, value)\n })\n return head\n }\n\n Body.call(Request.prototype)\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this._initBody(bodyInit)\n this.type = 'default'\n this.url = null\n this.status = options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText\n this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)\n this.url = options.url || ''\n }\n\n Body.call(Response.prototype)\n\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n\n self.fetch = function(input, init) {\n // TODO: Request constructor should accept input, init\n var request\n if (Request.prototype.isPrototypeOf(input) && !init) {\n request = input\n } else {\n request = new Request(input, init)\n }\n\n return new Promise(function(resolve, reject) {\n var xhr = new XMLHttpRequest()\n\n function responseURL() {\n if ('responseURL' in xhr) {\n return xhr.responseURL\n }\n\n // Avoid security warnings on getResponseHeader when not allowed by CORS\n if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {\n return xhr.getResponseHeader('X-Request-URL')\n }\n\n return;\n }\n\n xhr.onload = function() {\n var status = (xhr.status === 1223) ? 204 : xhr.status\n if (status < 100 || status > 599) {\n reject(new TypeError('Network request failed'))\n return\n }\n var options = {\n status: status,\n statusText: xhr.statusText,\n headers: headers(xhr),\n url: responseURL()\n }\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n }\n self.fetch.polyfill = true\n})();\n",
"var Reflux=require(\"reflux\");\r\nmodule.exports=Reflux.createActions([\"search\"]);",
"var React=require(\"react\");\nvar store=require(\"./store\");\nvar actions=require(\"./actions\");\nvar Reflux=require(\"reflux\");\nvar ucs2string=require(\"glyphemesearch\").ucs2string;\nvar getutf32=require(\"glyphemesearch\").getutf32;\nvar KageGlyph=require(\"./kageglyph\");\nvar E=React.createElement;\nvar useKage=require(\"./usekage\");\nvar styles={candidates:{outline:0,cursor:\"pointer\"}};\nvar fontserverurl=\"http://chikage.linode.caasih.net/exploded/?inputs=\";\n\n//window.Promise=require(\"promise-polyfill\");\nrequire(\"whatwg-fetch\");\nvar Candidates=React.createClass({displayName: \"Candidates\",\n\tmixins:[Reflux.listenTo(store,\"onData\")]\n\t,getInitialState:function(){\n\t\treturn {candidates:[],joined:[]};\n\t}\n\t,fontcache:{} //buhins already in memory\n\t,loading:[] //loading buhins\n\n\t,load:function(buhins) {\n\t\tvar that = this;\n\t\tvar data = {};\n\t\tvar k;\n\n\t\tfor (k in buhins) {\n\t\t\tdata[k] = buhins[k].replace(/@\\d+/g, \"\"); //workaround @n at the end\n\t\t}\n\t\tKageGlyph.loadBuhins(data);\n\t\tthis.loading.forEach(function(glyph){\n\t\t\tconsole.log(glyph);\n\t\t\tthat.fontcache[glyph]=true\n\t\t});\n\t\tthis.loading=[];\n\t\tthis.fontdataready=true;\n\t\tthis.setState({candidates:this.renderCandidates(this.state.searchresult)});\n\n\t\treturn;\n\t}\n\t,loadFromServer:function() {\n\t\tvar url=fontserverurl+this.loading.join(\"\");\n\t\tfetch(url)\n\t\t\t.then(function(response){ return response.json(); })\n\t\t\t.then(this.load);\n\t}\n\t,renderCandidates:function(searchresult) {\n\t\tvar o=[];\n\t\tfor (var i=0;i<searchresult.length;i++) {\n\t\t\tvar glyph=ucs2string(searchresult[i]);\n\t\t\tif (useKage(searchresult[i])){\n\t\t\t\tif (this.fontcache[glyph]) {\n\t\t\t\t\to.push(E(KageGlyph,{key:i,glyph:\"u\"+searchresult[i].toString(16)}));\n\t\t\t\t} else {\n\t\t\t\t\tthis.loading.push(glyph);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\to.push(glyph);\n\t\t\t}\n\t\t}\n\t\tif (this.loading.length) {\n\t\t\tthis.loadFromServer();\n\t\t}\n\t\treturn o;\n\t}\n\n\t,onData:function(data) {\n\t\tthis.fontdataready=false;\n\t\tthis.setState({searchresult:data,candidates:this.renderCandidates(data)});\n\t}\n\t,isHighSurrogate:function(code) {\n\t\treturn code>=0xD800 && code<=0xDBFF;\n\t}\n\t,getGlyphInfo:function(glyph) {\n\t\tthis.props.action(\"selectglyph\",glyph);\n\t}\n\t,onselect:function(e) {\n\t\tvar svglabel=e.target.parentNode.attributes[\"label\"];\n\t\tif (svglabel) svglabel=ucs2string(parseInt(\"0x\"+svglabel.value.substr(1)));\n\n\t\tvar selChar=svglabel||e.target.innerText;\n\t\t\n\t\tif (selChar) {\n\t\t\tif (this.prevSelected) this.prevSelected.style.background=\"silver\";\n\t\t\te.target.style.background=\"yellow\";\n\t\t\tthis.prevSelected=e.target;\n\t\t\tthis.getGlyphInfo(selChar);\n\t\t}\n\t}\n\t,render:function() {\n\t\treturn E(\"span\",{ref:\"candidates\",\n\t\t\tonMouseUp:this.onselect,onTouchTap:this.onselect,\n\t\t\tstyle:styles.candidates},this.state.candidates);\n\t}\n});\nmodule.exports=Candidates;\n",
"var React=require(\"react\");\r\nvar getutf32=require(\"glyphemesearch\").getutf32;\r\nvar E=React.createElement;\r\nvar styles={thechar:{fontSize:\"300%\"}};\r\nvar KageGlyph=require(\"./kageglyph\");\r\nvar style={textDecoration:\"none\"};\r\nvar useKage=require(\"./usekage\");\r\nvar planeFromCodePoint=function(cp) {\r\n\tif (cp>=0x3400 && cp<0x4e00) return \"Ext A\";\r\n\tif (cp>=0x4e00 && cp<0x9FFF) return \"Basic Multilingual Plane\";\r\n\tif (cp>=0x20000 && cp<=0x2A6DF) return \"Ext B\";\r\n\tif (cp>=0x2A700 && cp<=0x2B73F) return \"Ext C\"; //2A700–2B73F\r\n\tif (cp>=0x2B740 && cp<=0x2B81F) return \"Ext D\";//2B740–2B81F\r\n\tif (cp>=0x2B820 && cp<=0x2CEAF) return \"Ext E\";//2B820–2CEAF\r\n\treturn \"\";\r\n}\r\nvar GlyphInfo=React.createClass({displayName: \"GlyphInfo\",\r\n\trender:function() {\r\n\t\tvar glyph=this.props.glyph;\r\n\t\tvar utf32=getutf32({widestring:glyph});\r\n\t\tvar codepoint=utf32.toString(16).toUpperCase();\r\n\t\tvar unihan=\"http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=\"+codepoint;\r\n\t\tvar xiaoxue=\"http://xiaoxue.iis.sinica.edu.tw/?char=\"+glyph;\r\n\t\tvar plane=planeFromCodePoint(utf32);\r\n\t\tif (useKage(utf32)) glyph=E(KageGlyph,{size:100,glyph:\"u\"+utf32.toString(16)}) ;\r\n\t\treturn E(\"div\",{},\r\n\t\t\tE(\"a\",{target:\"_new\",style:style,title:\"Unihan\",href:unihan},\"U+\"+codepoint),\r\n\t\t\tE(\"span\",{style:styles.thechar}, \r\n\t\t\t\tE(\"a\",{target:\"_new\",style:style,title:\"小學堂\",href:xiaoxue},glyph)),\r\n\t\t\tE(\"span\",null, plane)\r\n\t\t\t);\r\n\t}\r\n});\r\nmodule.exports=GlyphInfo;",
"var React=require(\"react\");\r\nvar actions=require(\"./actions\");\r\n\r\nvar E=React.createElement;\r\nvar styles={\r\n\tlogo:{fontSize:\"150%\",textDecoration:\"none\"},\r\n\ttofind:{fontSize:\"200%\"}\r\n}\r\nvar GlyphSearch=React.createClass({displayName: \"GlyphSearch\",\r\n\tgetInitialState:function() {\r\n\t\treturn {successor:false,tofind:localStorage.getItem(\"z0y_tofind\")||\"木口\"};\r\n\t}\r\n\t,dosearch:function(){\r\n\t\tactions.search(this.state.tofind,this.state.successor);\r\n\t\tlocalStorage.setItem(\"z0y_tofind\",this.state.tofind);\r\n\t}\r\n\t,onchange:function(e){\r\n\t\tclearTimeout(this.timer);\r\n\t\tvar tofind=e.target.value;\r\n\t\tthis.setState({tofind:tofind});\r\n\t\tthis.timer=setTimeout(function(){\r\n\t\t\tthis.dosearch();\r\n\t\t}.bind(this),500);\r\n\t}\r\n\t,onkeypress:function(e) {\r\n\t\tif (e.key==\"Enter\") {\r\n\t\t\tthis.dosearch();\r\n\t\t}\r\n\t}\r\n\t,toggleSuccessor:function(e) {\r\n\t\tthis.setState({successor:e.target.checked},function(){\r\n\t\t\tthis.dosearch();\r\n\t\t}.bind(this));\r\n\t}\r\n\t,componentDidMount:function() {\r\n\t\tvar that=this;\r\n\t\tsetTimeout(function(){\r\n\t\t\tthat.refs.tofind.getDOMNode().focus();\r\n\t\t},500);\r\n\t}\r\n\t,render:function() {\r\n\t\treturn E(\"div\",{},\r\n\t\t\tE(\"a\",{style:styles.logo,href:\"https://github.com/g0v/z0y\"},\"零時字引\"),\r\n\t\t\tE(\"input\",{ref:\"tofind\",size:3,style:styles.tofind, value:this.state.tofind,\r\n\t\t\t onChange:this.onchange,onKeyPress:this.onkeypress}),\r\n\t\t\tE(\"label\",null,\r\n\t\t\t\tE(\"input\",{type:\"checkbox\",onChange:this.toggleSuccessor,value:this.state.successor})\r\n\t\t\t,\"深拆\")\r\n\t\t);\r\n\t}\r\n});\r\nmodule.exports=GlyphSearch;",
"var Kage=require(\"kage\").Kage;\r\nvar Polygons=require(\"kage\").Polygons;\r\nvar React=require(\"react\");\r\nvar E=React.createElement;\r\n//var mockdata=require(\"./mockdata\");\r\n//var glyphs=[\"u5361\",\"u897f\",\"u52a0\",\"u6cb9\"];\r\nvar kage = new Kage();\r\nkage.kUseCurve = true;\r\nvar loadBuhins=function(fromserver){\r\n\tfor (var buhin in fromserver) {\r\n\t\tkage.kBuhin.push(buhin,fromserver[buhin]);\r\n\t}\r\n}\r\n//loadBuhins(mockdata);\r\n\r\nvar KageGlyph=React.createClass({displayName: \"KageGlyph\",\r\n\tpropTypes:{\r\n\t\tglyph:React.PropTypes.string.isRequired\r\n\t\t,size:React.PropTypes.number\r\n\t}\r\n\t,render:function(){\r\n\t\tvar polygons = new Polygons();\r\n\t\tvar glyph=this.props.glyph;\r\n\t\t//glyph=\"u2b101\"\r\n\t\tkage.makeGlyph(polygons, glyph);\r\n var svg=polygons.generateSVG(true);\r\n\r\n //viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"\r\n size=this.props.size||32;\r\n svg=svg.replace('viewBox=\"0 0 200 200\" width=\"200\" height=\"200\"',\r\n 'background-color=\"transparent\" viewBox=\"0 0 200 200\" width=\"'+size+'\" height=\"'+size+'\"');\r\n\t\treturn E(\"span\",{label:this.props.glyph, dangerouslySetInnerHTML:{__html:svg}});\r\n\t}\r\n});\r\nKageGlyph.loadBuhins=loadBuhins;\r\nmodule.exports=KageGlyph;",
"var React=require(\"react\");\r\nvar GlyphSearch=require(\"./glyphsearch\");\r\nvar GlyphInfo=require(\"./glyphinfo\");\r\nvar Candidates=require(\"./candidates\");\r\nvar E=React.createElement;\r\n\r\nvar maincomponent = React.createClass({displayName: \"maincomponent\",\r\n getInitialState:function() {\r\n return {glyph:\" \"};\r\n },\r\n action:function(act,p1,p2) {\r\n if (act==\"selectglyph\") {\r\n this.setState({glyph:p1});\r\n }\r\n },\r\n render: function() {\r\n return E(\"div\",{},\r\n E(GlyphSearch),\r\n E(GlyphInfo,{glyph:this.state.glyph}),\r\n E(Candidates,{action:this.action})\r\n )\r\n }\r\n});\r\nmodule.exports=maincomponent;",
"var Reflux=require(\"reflux\");\r\nvar actions=require(\"./actions\");\r\nvar glyphemesearch=require(\"glyphemesearch\");\r\nvar store=Reflux.createStore({\r\n\tlistenables:actions\r\n\t,onSearch:function(glypheme,successor) {\r\n\t\t//console.log(\"toggle\",itemidx);\r\n\t\t\r\n\t\tthis.trigger(glyphemesearch(glypheme,successor));\r\n\t}\r\n});\r\n\r\nmodule.exports=store;",
"var nua = navigator.userAgent;\r\n\r\nvar useKage=function(utf32) {\r\n\tvar systemfontends=0x2A700;\r\n\tvar iOS = ( nua.match(/iPad|iPhone|iPod/g) ? true : false );\r\n\r\n\tif (nua.indexOf('Android ')>-1)systemfontends=0x20000;\r\n\tif (iOS) systemfontends=0x20000;\r\n\t\r\n\treturn utf32>=systemfontends;\r\n}\r\nmodule.exports=useKage;"
]
}