@plaidev/karte-action-sdk 1.1.119-27929222.4cbf467a → 1.1.119-27929495.c92443f3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { writable, get } from 'svelte/store';
2
2
  import 'svelte/easing';
3
- import { SvelteComponent, init, safe_not_equal, append_styles, create_slot, create_component, space, claim_component, claim_space, mount_component, insert_hydration, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, detach, empty, group_outros, check_outros, component_subscribe, element, claim_element, children, attr, noop, listen, is_function, append_hydration, add_render_callback, create_in_transition, svg_element, claim_svg_element, binding_callbacks, destroy_each, text, claim_text, set_data, null_to_empty, src_url_equal, set_style } from 'svelte/internal';
3
+ import { SvelteComponent, init, safe_not_equal, append_styles, create_slot, create_component, space, claim_component, claim_space, mount_component, insert_hydration, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, detach, empty, group_outros, check_outros, component_subscribe, element, claim_element, children, attr, noop, listen, is_function, append_hydration, add_render_callback, create_in_transition, svg_element, claim_svg_element, binding_callbacks, destroy_each, text, claim_text, set_data, null_to_empty, src_url_equal } from 'svelte/internal';
4
4
  import { setContext, getContext, createEventDispatcher, onMount, onDestroy as onDestroy$1 } from 'svelte';
5
5
 
6
6
  /** @internal */
@@ -586,6 +586,104 @@ function updateCustomVariables(variables) {
586
586
  */
587
587
  const formData = writable({});
588
588
 
589
+ function isEmpty(value) {
590
+ if (Array.isArray(value)) {
591
+ return value.length === 0;
592
+ }
593
+ else {
594
+ return !value;
595
+ }
596
+ }
597
+ /** @internal */
598
+ function registerInput({ name, statePath, validator = () => true, initialValue, }) {
599
+ const writableValue = {
600
+ subscribe(run) {
601
+ return formData.subscribe(formData => {
602
+ run(formData[name]?.value);
603
+ });
604
+ },
605
+ set(value) {
606
+ formData.update(prev => ({
607
+ ...prev,
608
+ [name]: {
609
+ statePath,
610
+ value,
611
+ isValid: validator(value),
612
+ },
613
+ }));
614
+ },
615
+ update(updater) {
616
+ formData.update(prev => {
617
+ const prevValue = prev[name]?.value;
618
+ return {
619
+ ...prev,
620
+ [name]: {
621
+ statePath,
622
+ value: updater(prevValue),
623
+ isValid: validator(prevValue),
624
+ },
625
+ };
626
+ });
627
+ },
628
+ };
629
+ if (isEmpty(get(writableValue))) {
630
+ writableValue.set(initialValue);
631
+ }
632
+ return writableValue;
633
+ }
634
+ /** @internal */
635
+ const getValuesAreValidReader = statePath => ({
636
+ subscribe(callback) {
637
+ return formData.subscribe(formData => {
638
+ const valuesAreValid = Object.entries(formData)
639
+ .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
640
+ .every(([_, { isValid }]) => isValid); // eslint-disable-line @typescript-eslint/no-unused-vars
641
+ callback(valuesAreValid);
642
+ });
643
+ },
644
+ });
645
+ function formDataToEventValues(campaignId, formData) {
646
+ const questions = [];
647
+ const answersMap = {};
648
+ Object.entries(formData).forEach(([name, dataItem]) => {
649
+ questions.push(name);
650
+ const value = dataItem.value;
651
+ const answerKey = `question_${name}`;
652
+ if (Array.isArray(value)) {
653
+ answersMap[answerKey] = {
654
+ choices: value,
655
+ };
656
+ }
657
+ else if (typeof value === 'string') {
658
+ answersMap[answerKey] = {
659
+ free_answer: value,
660
+ };
661
+ }
662
+ });
663
+ return {
664
+ [campaignId]: {
665
+ questions,
666
+ ...answersMap,
667
+ },
668
+ };
669
+ }
670
+ /** @internal */
671
+ function submit() {
672
+ const systemConfig = getSystem();
673
+ const campaignId = systemConfig.campaignId;
674
+ if (campaignId) {
675
+ const formData$1 = get(formData);
676
+ const values = formDataToEventValues(campaignId, formData$1);
677
+ return values;
678
+ }
679
+ {
680
+ const formData$1 = get(formData);
681
+ const values = formDataToEventValues('mock', formData$1);
682
+ console.log('values: ', values);
683
+ return values;
684
+ }
685
+ }
686
+
589
687
  /** @internal */
590
688
  const ALL_ACTION_ID = 'KARTE_ALL_ACTION_ID';
591
689
  /** @internal */
@@ -631,10 +729,13 @@ const send_event = (event_name, values) => {
631
729
  const setting = getActionSetting();
632
730
  setting?.send?.(event_name, values);
633
731
  };
634
- /** @internal */
635
- const moveTo = (to) => () => {
732
+ function _moveTo(to) {
636
733
  send_event('_message_state_changed', { state: to });
637
734
  window.dispatchEvent(new CustomEvent(ACTION_CHANGE_STATE_EVENT, { detail: { to, actionId } }));
735
+ }
736
+ /** @internal */
737
+ const moveTo = (to) => () => {
738
+ _moveTo(to);
638
739
  };
639
740
  /** @internal */
640
741
  const linkTo = (to, targetBlank = true) => () => {
@@ -664,6 +765,21 @@ const runScript = (handlerName) => () => {
664
765
  }
665
766
  };
666
767
  /** @internal */
768
+ const submitForm = (to) => () => {
769
+ const values = submit();
770
+ send_event('_answer_question', values);
771
+ _moveTo(to);
772
+ };
773
+ /** @internal */
774
+ const nextForm = (to) => () => {
775
+ _moveTo(to);
776
+ };
777
+ /** @internal */
778
+ const prevForm = (to) => () => {
779
+ // deleteValues(stateId);
780
+ _moveTo(to);
781
+ };
782
+ /** @internal */
667
783
  const execOnClickOperation = (onClickOperation) => {
668
784
  if (onClickOperation.operation === 'linkTo') {
669
785
  linkTo(...onClickOperation.args)();
@@ -677,6 +793,15 @@ const execOnClickOperation = (onClickOperation) => {
677
793
  else if (onClickOperation.operation === 'runScript') {
678
794
  runScript(onClickOperation.args[0])();
679
795
  }
796
+ else if (onClickOperation.operation === 'submitForm') {
797
+ submitForm(onClickOperation.args[0])();
798
+ }
799
+ else if (onClickOperation.operation === 'nextForm') {
800
+ nextForm(onClickOperation.args[0])();
801
+ }
802
+ else if (onClickOperation.operation === 'prevForm') {
803
+ prevForm(onClickOperation.args[0])();
804
+ }
680
805
  };
681
806
  /** @internal */
682
807
  const haveFunction = (onClickOperation) => {
@@ -992,11 +1117,8 @@ const OnClickOperationOptions = [
992
1117
  },
993
1118
  ],
994
1119
  },
995
- ];
996
- /** @internal */
997
- const FormOperationOptions = [
998
1120
  {
999
- operation: 'submit',
1121
+ operation: 'submitForm',
1000
1122
  args: [
1001
1123
  {
1002
1124
  type: 'TransitState',
@@ -1005,7 +1127,7 @@ const FormOperationOptions = [
1005
1127
  ],
1006
1128
  },
1007
1129
  {
1008
- operation: 'next',
1130
+ operation: 'nextForm',
1009
1131
  args: [
1010
1132
  {
1011
1133
  type: 'TransitState',
@@ -1014,7 +1136,7 @@ const FormOperationOptions = [
1014
1136
  ],
1015
1137
  },
1016
1138
  {
1017
- operation: 'prev',
1139
+ operation: 'prevForm',
1018
1140
  args: [
1019
1141
  {
1020
1142
  type: 'TransitState',
@@ -1943,7 +2065,7 @@ class Normalize extends SvelteComponent {
1943
2065
 
1944
2066
  /* src/components/State.svelte generated by Svelte v3.53.1 */
1945
2067
 
1946
- function create_fragment$r(ctx) {
2068
+ function create_fragment$q(ctx) {
1947
2069
  let normalize;
1948
2070
  let t;
1949
2071
  let current;
@@ -2007,7 +2129,7 @@ function create_fragment$r(ctx) {
2007
2129
  };
2008
2130
  }
2009
2131
 
2010
- function instance$r($$self, $$props, $$invalidate) {
2132
+ function instance$q($$self, $$props, $$invalidate) {
2011
2133
  let { $$slots: slots = {}, $$scope } = $$props;
2012
2134
 
2013
2135
  $$self.$$set = $$props => {
@@ -2020,7 +2142,7 @@ function instance$r($$self, $$props, $$invalidate) {
2020
2142
  class State extends SvelteComponent {
2021
2143
  constructor(options) {
2022
2144
  super();
2023
- init(this, options, instance$r, create_fragment$r, safe_not_equal, {});
2145
+ init(this, options, instance$q, create_fragment$q, safe_not_equal, {});
2024
2146
  }
2025
2147
  }
2026
2148
 
@@ -2103,7 +2225,7 @@ function create_if_block$5(ctx) {
2103
2225
  };
2104
2226
  }
2105
2227
 
2106
- function create_fragment$q(ctx) {
2228
+ function create_fragment$p(ctx) {
2107
2229
  let if_block_anchor;
2108
2230
  let current;
2109
2231
  let if_block = /*$state*/ ctx[1] === /*path*/ ctx[0] && create_if_block$5(ctx);
@@ -2168,7 +2290,7 @@ function getStateItemContext() {
2168
2290
  return getContext(STATE_ITEM_CONTEXT_KEY);
2169
2291
  }
2170
2292
 
2171
- function instance$q($$self, $$props, $$invalidate) {
2293
+ function instance$p($$self, $$props, $$invalidate) {
2172
2294
  let $state;
2173
2295
  component_subscribe($$self, state, $$value => $$invalidate(1, $state = $$value));
2174
2296
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -2194,7 +2316,7 @@ function instance$q($$self, $$props, $$invalidate) {
2194
2316
  class StateItem extends SvelteComponent {
2195
2317
  constructor(options) {
2196
2318
  super();
2197
- init(this, options, instance$q, create_fragment$q, safe_not_equal, { path: 0 }, add_css$m);
2319
+ init(this, options, instance$p, create_fragment$p, safe_not_equal, { path: 0 }, add_css$m);
2198
2320
  }
2199
2321
  }
2200
2322
 
@@ -2240,7 +2362,7 @@ function create_if_block$4(ctx) {
2240
2362
  };
2241
2363
  }
2242
2364
 
2243
- function create_fragment$p(ctx) {
2365
+ function create_fragment$o(ctx) {
2244
2366
  let if_block_anchor;
2245
2367
  let if_block = /*backgroundOverray*/ ctx[0] && create_if_block$4(ctx);
2246
2368
 
@@ -2280,7 +2402,7 @@ function create_fragment$p(ctx) {
2280
2402
  };
2281
2403
  }
2282
2404
 
2283
- function instance$p($$self, $$props, $$invalidate) {
2405
+ function instance$o($$self, $$props, $$invalidate) {
2284
2406
  let { backgroundOverray = false } = $$props;
2285
2407
  const dispatch = createEventDispatcher();
2286
2408
  const click_handler = () => dispatch('click');
@@ -2295,7 +2417,7 @@ function instance$p($$self, $$props, $$invalidate) {
2295
2417
  class BackgroundOverray extends SvelteComponent {
2296
2418
  constructor(options) {
2297
2419
  super();
2298
- init(this, options, instance$p, create_fragment$p, safe_not_equal, { backgroundOverray: 0 }, add_css$l);
2420
+ init(this, options, instance$o, create_fragment$o, safe_not_equal, { backgroundOverray: 0 }, add_css$l);
2299
2421
  }
2300
2422
  }
2301
2423
 
@@ -2531,7 +2653,7 @@ function create_if_block_1$1(ctx) {
2531
2653
  };
2532
2654
  }
2533
2655
 
2534
- function create_fragment$o(ctx) {
2656
+ function create_fragment$n(ctx) {
2535
2657
  let backgroundoverray;
2536
2658
  let t;
2537
2659
  let if_block_anchor;
@@ -2630,7 +2752,7 @@ function create_fragment$o(ctx) {
2630
2752
  };
2631
2753
  }
2632
2754
 
2633
- function instance$o($$self, $$props, $$invalidate) {
2755
+ function instance$n($$self, $$props, $$invalidate) {
2634
2756
  let click;
2635
2757
  let close;
2636
2758
  let closable;
@@ -2821,8 +2943,8 @@ class Modal extends SvelteComponent {
2821
2943
  init(
2822
2944
  this,
2823
2945
  options,
2824
- instance$o,
2825
- create_fragment$o,
2946
+ instance$n,
2947
+ create_fragment$n,
2826
2948
  safe_not_equal,
2827
2949
  {
2828
2950
  onClick: 17,
@@ -2845,7 +2967,7 @@ class Modal extends SvelteComponent {
2845
2967
 
2846
2968
  /* src/components/Grid.svelte generated by Svelte v3.53.1 */
2847
2969
 
2848
- function create_fragment$n(ctx) {
2970
+ function create_fragment$m(ctx) {
2849
2971
  let div;
2850
2972
  let current;
2851
2973
  const default_slot_template = /*#slots*/ ctx[8].default;
@@ -2913,7 +3035,7 @@ function create_fragment$n(ctx) {
2913
3035
  };
2914
3036
  }
2915
3037
 
2916
- function instance$n($$self, $$props, $$invalidate) {
3038
+ function instance$m($$self, $$props, $$invalidate) {
2917
3039
  let _style;
2918
3040
  let { $$slots: slots = {}, $$scope } = $$props;
2919
3041
  let { width = '512px' } = $$props;
@@ -2958,7 +3080,7 @@ class Grid extends SvelteComponent {
2958
3080
  constructor(options) {
2959
3081
  super();
2960
3082
 
2961
- init(this, options, instance$n, create_fragment$n, safe_not_equal, {
3083
+ init(this, options, instance$m, create_fragment$m, safe_not_equal, {
2962
3084
  width: 1,
2963
3085
  height: 2,
2964
3086
  rows: 3,
@@ -3149,7 +3271,7 @@ function create_default_slot(ctx) {
3149
3271
  };
3150
3272
  }
3151
3273
 
3152
- function create_fragment$m(ctx) {
3274
+ function create_fragment$l(ctx) {
3153
3275
  let stateitem;
3154
3276
  let current;
3155
3277
 
@@ -3197,7 +3319,7 @@ function create_fragment$m(ctx) {
3197
3319
  };
3198
3320
  }
3199
3321
 
3200
- function instance$m($$self, $$props, $$invalidate) {
3322
+ function instance$l($$self, $$props, $$invalidate) {
3201
3323
  let { $$slots: slots = {}, $$scope } = $$props;
3202
3324
  let { path } = $$props;
3203
3325
  let { onClick = { operation: 'none', args: [] } } = $$props;
@@ -3268,7 +3390,7 @@ class GridModalState extends SvelteComponent {
3268
3390
  constructor(options) {
3269
3391
  super();
3270
3392
 
3271
- init(this, options, instance$m, create_fragment$m, safe_not_equal, {
3393
+ init(this, options, instance$l, create_fragment$l, safe_not_equal, {
3272
3394
  path: 0,
3273
3395
  onClick: 1,
3274
3396
  clickEventName: 2,
@@ -3297,7 +3419,7 @@ function add_css$j(target) {
3297
3419
  append_styles(target, "svelte-n7kdl3", ".grid-item.svelte-n7kdl3{word-break:break-all;position:relative}.grid-item-inner.svelte-n7kdl3{position:absolute;inset:0}");
3298
3420
  }
3299
3421
 
3300
- function create_fragment$l(ctx) {
3422
+ function create_fragment$k(ctx) {
3301
3423
  let div1;
3302
3424
  let div0;
3303
3425
  let current;
@@ -3378,7 +3500,7 @@ function create_fragment$l(ctx) {
3378
3500
  };
3379
3501
  }
3380
3502
 
3381
- function instance$l($$self, $$props, $$invalidate) {
3503
+ function instance$k($$self, $$props, $$invalidate) {
3382
3504
  let _style;
3383
3505
  let { $$slots: slots = {}, $$scope } = $$props;
3384
3506
  let { x1 } = $$props;
@@ -3431,8 +3553,8 @@ class GridItem extends SvelteComponent {
3431
3553
  init(
3432
3554
  this,
3433
3555
  options,
3434
- instance$l,
3435
- create_fragment$l,
3556
+ instance$k,
3557
+ create_fragment$k,
3436
3558
  safe_not_equal,
3437
3559
  {
3438
3560
  x1: 2,
@@ -3453,7 +3575,7 @@ function add_css$i(target) {
3453
3575
  append_styles(target, "svelte-1e71ejc", ".flex.svelte-1e71ejc{display:flex}");
3454
3576
  }
3455
3577
 
3456
- function create_fragment$k(ctx) {
3578
+ function create_fragment$j(ctx) {
3457
3579
  let div;
3458
3580
  let div_style_value;
3459
3581
  let current;
@@ -3528,7 +3650,7 @@ function getFlexContext() {
3528
3650
  return getContext(FlexContextKey);
3529
3651
  }
3530
3652
 
3531
- function instance$k($$self, $$props, $$invalidate) {
3653
+ function instance$j($$self, $$props, $$invalidate) {
3532
3654
  let { $$slots: slots = {}, $$scope } = $$props;
3533
3655
  let { direction = 'row' } = $$props;
3534
3656
  let { width = '100%' } = $$props;
@@ -3554,8 +3676,8 @@ class Flex extends SvelteComponent {
3554
3676
  init(
3555
3677
  this,
3556
3678
  options,
3557
- instance$k,
3558
- create_fragment$k,
3679
+ instance$j,
3680
+ create_fragment$j,
3559
3681
  safe_not_equal,
3560
3682
  {
3561
3683
  direction: 0,
@@ -3574,7 +3696,7 @@ function add_css$h(target) {
3574
3696
  append_styles(target, "svelte-1p0bk1x", ".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}");
3575
3697
  }
3576
3698
 
3577
- function create_fragment$j(ctx) {
3699
+ function create_fragment$i(ctx) {
3578
3700
  let div;
3579
3701
  let current;
3580
3702
  const default_slot_template = /*#slots*/ ctx[4].default;
@@ -3642,7 +3764,7 @@ function create_fragment$j(ctx) {
3642
3764
  };
3643
3765
  }
3644
3766
 
3645
- function instance$j($$self, $$props, $$invalidate) {
3767
+ function instance$i($$self, $$props, $$invalidate) {
3646
3768
  let { $$slots: slots = {}, $$scope } = $$props;
3647
3769
  let { length } = $$props;
3648
3770
  let { _style = '' } = $$props;
@@ -3685,7 +3807,7 @@ function instance$j($$self, $$props, $$invalidate) {
3685
3807
  class FlexItem extends SvelteComponent {
3686
3808
  constructor(options) {
3687
3809
  super();
3688
- init(this, options, instance$j, create_fragment$j, safe_not_equal, { length: 1, _style: 2 }, add_css$h);
3810
+ init(this, options, instance$i, create_fragment$i, safe_not_equal, { length: 1, _style: 2 }, add_css$h);
3689
3811
  }
3690
3812
  }
3691
3813
 
@@ -3790,7 +3912,7 @@ function create_each_block$4(ctx) {
3790
3912
  };
3791
3913
  }
3792
3914
 
3793
- function create_fragment$i(ctx) {
3915
+ function create_fragment$h(ctx) {
3794
3916
  let each_1_anchor;
3795
3917
  let each_value = /*items*/ ctx[0];
3796
3918
  let each_blocks = [];
@@ -3856,7 +3978,7 @@ function create_fragment$i(ctx) {
3856
3978
 
3857
3979
  const regexp = /(\r?\n)/;
3858
3980
 
3859
- function instance$i($$self, $$props, $$invalidate) {
3981
+ function instance$h($$self, $$props, $$invalidate) {
3860
3982
  let items;
3861
3983
  let { text = 'サンプルSample' } = $$props;
3862
3984
 
@@ -3876,7 +3998,7 @@ function instance$i($$self, $$props, $$invalidate) {
3876
3998
  class RenderText extends SvelteComponent {
3877
3999
  constructor(options) {
3878
4000
  super();
3879
- init(this, options, instance$i, create_fragment$i, safe_not_equal, { text: 1 });
4001
+ init(this, options, instance$h, create_fragment$h, safe_not_equal, { text: 1 });
3880
4002
  }
3881
4003
  }
3882
4004
 
@@ -3886,7 +4008,7 @@ function add_css$g(target) {
3886
4008
  append_styles(target, "svelte-9en2jg", ".text-element.svelte-9en2jg.svelte-9en2jg{display:flex;position:relative;width:100%;height:100%;box-sizing:border-box;white-space:pre-wrap;overflow:auto}.text-element-inner.svelte-9en2jg.svelte-9en2jg{width:100%;height:auto}.text-direction-vertical.svelte-9en2jg.svelte-9en2jg{writing-mode:vertical-rl}.text-direction-vertical.svelte-9en2jg .text-element-inner.svelte-9en2jg{width:auto;height:100%}");
3887
4009
  }
3888
4010
 
3889
- function create_fragment$h(ctx) {
4011
+ function create_fragment$g(ctx) {
3890
4012
  let div1;
3891
4013
  let div0;
3892
4014
  let rendertext;
@@ -3951,7 +4073,7 @@ function create_fragment$h(ctx) {
3951
4073
  };
3952
4074
  }
3953
4075
 
3954
- function instance$h($$self, $$props, $$invalidate) {
4076
+ function instance$g($$self, $$props, $$invalidate) {
3955
4077
  let style;
3956
4078
  let { text = 'サンプルSample' } = $$props;
3957
4079
  let { _textStyle = 'font-size:12px;' } = $$props;
@@ -3981,8 +4103,8 @@ class TextElement extends SvelteComponent {
3981
4103
  init(
3982
4104
  this,
3983
4105
  options,
3984
- instance$h,
3985
- create_fragment$h,
4106
+ instance$g,
4107
+ create_fragment$g,
3986
4108
  safe_not_equal,
3987
4109
  {
3988
4110
  text: 0,
@@ -3998,13 +4120,15 @@ class TextElement extends SvelteComponent {
3998
4120
  /* src/components/TextButtonElement.svelte generated by Svelte v3.53.1 */
3999
4121
 
4000
4122
  function add_css$f(target) {
4001
- append_styles(target, "svelte-tx5xf5", ".text-button-element.svelte-tx5xf5{width:100%;height:100%}.text-button.svelte-tx5xf5{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background-color:transparent;border:none;box-shadow:transparent;box-sizing:border-box;cursor:pointer;transition:box-shadow 0.2s;white-space:pre-wrap;overflow:hidden}.text-button.svelte-tx5xf5:active{box-shadow:inset 0 0 100px 100px rgba(0, 0, 0, 0.3)}.text-button.svelte-tx5xf5:hover{box-shadow:inset 0 0 100px 100px rgba(255, 255, 255, 0.3)}");
4123
+ append_styles(target, "svelte-1igv5yx", ".text-button-element.svelte-1igv5yx{width:100%;height:100%}.text-button-element._disabled.svelte-1igv5yx{opacity:0.2}.text-button.svelte-1igv5yx{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background-color:transparent;border:none;box-shadow:transparent;box-sizing:border-box;cursor:pointer;transition:box-shadow 0.2s;white-space:pre-wrap;overflow:hidden}.text-button._disabled.svelte-1igv5yx{cursor:not-allowed}.text-button.svelte-1igv5yx:active{box-shadow:inset 0 0 100px 100px rgba(0, 0, 0, 0.3)}.text-button.svelte-1igv5yx:hover{box-shadow:inset 0 0 100px 100px rgba(255, 255, 255, 0.3)}");
4002
4124
  }
4003
4125
 
4004
- function create_fragment$g(ctx) {
4126
+ function create_fragment$f(ctx) {
4005
4127
  let div;
4006
4128
  let button;
4007
4129
  let rendertext;
4130
+ let button_class_value;
4131
+ let div_class_value;
4008
4132
  let current;
4009
4133
  let mounted;
4010
4134
  let dispose;
@@ -4028,9 +4152,10 @@ function create_fragment$g(ctx) {
4028
4152
  this.h();
4029
4153
  },
4030
4154
  h() {
4031
- attr(button, "class", "text-button svelte-tx5xf5");
4155
+ attr(button, "class", button_class_value = "" + (null_to_empty(`text-button${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"));
4032
4156
  attr(button, "style", /*_buttonStyle*/ ctx[1]);
4033
- attr(div, "class", "text-button-element svelte-tx5xf5");
4157
+ button.disabled = /*disabled*/ ctx[3];
4158
+ attr(div, "class", div_class_value = "" + (null_to_empty(`text-button-element${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"));
4034
4159
  attr(div, "style", /*_style*/ ctx[2]);
4035
4160
  },
4036
4161
  m(target, anchor) {
@@ -4040,7 +4165,7 @@ function create_fragment$g(ctx) {
4040
4165
  current = true;
4041
4166
 
4042
4167
  if (!mounted) {
4043
- dispose = listen(button, "click", /*click*/ ctx[3]);
4168
+ dispose = listen(button, "click", /*click*/ ctx[4]);
4044
4169
  mounted = true;
4045
4170
  }
4046
4171
  },
@@ -4049,10 +4174,22 @@ function create_fragment$g(ctx) {
4049
4174
  if (dirty & /*text*/ 1) rendertext_changes.text = /*text*/ ctx[0];
4050
4175
  rendertext.$set(rendertext_changes);
4051
4176
 
4177
+ if (!current || dirty & /*disabled*/ 8 && button_class_value !== (button_class_value = "" + (null_to_empty(`text-button${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"))) {
4178
+ attr(button, "class", button_class_value);
4179
+ }
4180
+
4052
4181
  if (!current || dirty & /*_buttonStyle*/ 2) {
4053
4182
  attr(button, "style", /*_buttonStyle*/ ctx[1]);
4054
4183
  }
4055
4184
 
4185
+ if (!current || dirty & /*disabled*/ 8) {
4186
+ button.disabled = /*disabled*/ ctx[3];
4187
+ }
4188
+
4189
+ if (!current || dirty & /*disabled*/ 8 && div_class_value !== (div_class_value = "" + (null_to_empty(`text-button-element${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"))) {
4190
+ attr(div, "class", div_class_value);
4191
+ }
4192
+
4056
4193
  if (!current || dirty & /*_style*/ 4) {
4057
4194
  attr(div, "style", /*_style*/ ctx[2]);
4058
4195
  }
@@ -4075,7 +4212,9 @@ function create_fragment$g(ctx) {
4075
4212
  };
4076
4213
  }
4077
4214
 
4078
- function instance$g($$self, $$props, $$invalidate) {
4215
+ function instance$f($$self, $$props, $$invalidate) {
4216
+ let disabled;
4217
+ let $valuesAreValid;
4079
4218
  let { text = 'ボタンラベル' } = $$props;
4080
4219
  let { onClick = { operation: 'none', args: [] } } = $$props;
4081
4220
 
@@ -4090,16 +4229,45 @@ function instance$g($$self, $$props, $$invalidate) {
4090
4229
  let { eventName = '' } = $$props;
4091
4230
  let { _buttonStyle = 'color:#ffffff; font-size:14px; font-weight:bold; justify-content:center; align-items:center; padding:1px 6px 1px 6px;' } = $$props;
4092
4231
  let { _style = 'background-color: #000000; border-radius:4px;' } = $$props;
4232
+ const { path: statePath } = getStateItemContext() ?? { path: '/' };
4233
+ const valuesAreValid = getValuesAreValidReader(statePath);
4234
+ component_subscribe($$self, valuesAreValid, value => $$invalidate(8, $valuesAreValid = value));
4093
4235
 
4094
4236
  $$self.$$set = $$props => {
4095
4237
  if ('text' in $$props) $$invalidate(0, text = $$props.text);
4096
- if ('onClick' in $$props) $$invalidate(4, onClick = $$props.onClick);
4097
- if ('eventName' in $$props) $$invalidate(5, eventName = $$props.eventName);
4238
+ if ('onClick' in $$props) $$invalidate(6, onClick = $$props.onClick);
4239
+ if ('eventName' in $$props) $$invalidate(7, eventName = $$props.eventName);
4098
4240
  if ('_buttonStyle' in $$props) $$invalidate(1, _buttonStyle = $$props._buttonStyle);
4099
4241
  if ('_style' in $$props) $$invalidate(2, _style = $$props._style);
4100
4242
  };
4101
4243
 
4102
- return [text, _buttonStyle, _style, click, onClick, eventName];
4244
+ $$self.$$.update = () => {
4245
+ if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 320) {
4246
+ $$invalidate(3, disabled = (() => {
4247
+ let isEnabled = true;
4248
+
4249
+ if (onClick.operation === 'submitForm') {
4250
+ isEnabled = $valuesAreValid;
4251
+ } else if (onClick.operation === 'nextForm') {
4252
+ isEnabled = $valuesAreValid;
4253
+ }
4254
+
4255
+ return !isEnabled;
4256
+ })());
4257
+ }
4258
+ };
4259
+
4260
+ return [
4261
+ text,
4262
+ _buttonStyle,
4263
+ _style,
4264
+ disabled,
4265
+ click,
4266
+ valuesAreValid,
4267
+ onClick,
4268
+ eventName,
4269
+ $valuesAreValid
4270
+ ];
4103
4271
  }
4104
4272
 
4105
4273
  class TextButtonElement extends SvelteComponent {
@@ -4109,13 +4277,13 @@ class TextButtonElement extends SvelteComponent {
4109
4277
  init(
4110
4278
  this,
4111
4279
  options,
4112
- instance$g,
4113
- create_fragment$g,
4280
+ instance$f,
4281
+ create_fragment$f,
4114
4282
  safe_not_equal,
4115
4283
  {
4116
4284
  text: 0,
4117
- onClick: 4,
4118
- eventName: 5,
4285
+ onClick: 6,
4286
+ eventName: 7,
4119
4287
  _buttonStyle: 1,
4120
4288
  _style: 2
4121
4289
  },
@@ -4130,7 +4298,7 @@ function add_css$e(target) {
4130
4298
  append_styles(target, "svelte-t8kpqw", ".image-element.svelte-t8kpqw{display:flex;position:relative;width:100%;height:100%;max-width:100%;max-height:100%;justify-content:center;align-items:center;white-space:nowrap;box-sizing:border-box;overflow:hidden}.image.svelte-t8kpqw{width:100%;height:100%}.transport.svelte-t8kpqw:hover,.transport.svelte-t8kpqw:focus{opacity:0.75;box-shadow:0 5px 16px rgba(0, 0, 0, 0.1), 0 8px 28px rgba(0, 0, 0, 0.16)}");
4131
4299
  }
4132
4300
 
4133
- function create_fragment$f(ctx) {
4301
+ function create_fragment$e(ctx) {
4134
4302
  let div;
4135
4303
  let img;
4136
4304
  let img_src_value;
@@ -4212,7 +4380,7 @@ function create_fragment$f(ctx) {
4212
4380
  };
4213
4381
  }
4214
4382
 
4215
- function instance$f($$self, $$props, $$invalidate) {
4383
+ function instance$e($$self, $$props, $$invalidate) {
4216
4384
  let { src = 'https://admin.karte.io/action-editor2/public/images/no_image_en.svg' } = $$props;
4217
4385
  let { alt = 'No Image' } = $$props;
4218
4386
  let { transport = false } = $$props;
@@ -4250,8 +4418,8 @@ class ImageElement extends SvelteComponent {
4250
4418
  init(
4251
4419
  this,
4252
4420
  options,
4253
- instance$f,
4254
- create_fragment$f,
4421
+ instance$e,
4422
+ create_fragment$e,
4255
4423
  safe_not_equal,
4256
4424
  {
4257
4425
  src: 0,
@@ -4273,7 +4441,7 @@ function add_css$d(target) {
4273
4441
  append_styles(target, "svelte-dfqtyx", ".list.svelte-dfqtyx{display:flex;width:100%;height:100%;overflow:hidden}");
4274
4442
  }
4275
4443
 
4276
- function create_fragment$e(ctx) {
4444
+ function create_fragment$d(ctx) {
4277
4445
  let div;
4278
4446
  let current;
4279
4447
  const default_slot_template = /*#slots*/ ctx[6].default;
@@ -4343,7 +4511,7 @@ function create_fragment$e(ctx) {
4343
4511
 
4344
4512
  const LIST_CONTEXT_KEY = Symbol();
4345
4513
 
4346
- function instance$e($$self, $$props, $$invalidate) {
4514
+ function instance$d($$self, $$props, $$invalidate) {
4347
4515
  let style;
4348
4516
  let { $$slots: slots = {}, $$scope } = $$props;
4349
4517
  let { direction = 'vertical' } = $$props;
@@ -4410,8 +4578,8 @@ class List extends SvelteComponent {
4410
4578
  init(
4411
4579
  this,
4412
4580
  options,
4413
- instance$e,
4414
- create_fragment$e,
4581
+ instance$d,
4582
+ create_fragment$d,
4415
4583
  safe_not_equal,
4416
4584
  {
4417
4585
  direction: 1,
@@ -4430,7 +4598,7 @@ function add_css$c(target) {
4430
4598
  append_styles(target, "svelte-h5j4xe", ".list-item.svelte-h5j4xe{flex:auto;box-sizing:border-box;min-width:0;min-height:0;position:relative}.list-item-inner.svelte-h5j4xe{position:absolute;inset:0}");
4431
4599
  }
4432
4600
 
4433
- function create_fragment$d(ctx) {
4601
+ function create_fragment$c(ctx) {
4434
4602
  let div1;
4435
4603
  let div0;
4436
4604
  let current;
@@ -4524,7 +4692,7 @@ function create_fragment$d(ctx) {
4524
4692
  };
4525
4693
  }
4526
4694
 
4527
- function instance$d($$self, $$props, $$invalidate) {
4695
+ function instance$c($$self, $$props, $$invalidate) {
4528
4696
  let click;
4529
4697
  let listItemStyle;
4530
4698
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -4614,7 +4782,7 @@ function instance$d($$self, $$props, $$invalidate) {
4614
4782
  class ListItem extends SvelteComponent {
4615
4783
  constructor(options) {
4616
4784
  super();
4617
- init(this, options, instance$d, create_fragment$d, safe_not_equal, { onClick: 3, clickEventName: 4, _style: 0 }, add_css$c);
4785
+ init(this, options, instance$c, create_fragment$c, safe_not_equal, { onClick: 3, clickEventName: 4, _style: 0 }, add_css$c);
4618
4786
  }
4619
4787
  }
4620
4788
 
@@ -4624,7 +4792,7 @@ function add_css$b(target) {
4624
4792
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4625
4793
  }
4626
4794
 
4627
- function create_fragment$c(ctx) {
4795
+ function create_fragment$b(ctx) {
4628
4796
  let div;
4629
4797
 
4630
4798
  return {
@@ -4660,7 +4828,7 @@ function create_fragment$c(ctx) {
4660
4828
  };
4661
4829
  }
4662
4830
 
4663
- function instance$c($$self, $$props, $$invalidate) {
4831
+ function instance$b($$self, $$props, $$invalidate) {
4664
4832
  let { code } = $$props;
4665
4833
  let { _style = "" } = $$props;
4666
4834
 
@@ -4675,7 +4843,7 @@ function instance$c($$self, $$props, $$invalidate) {
4675
4843
  class EmbedElement extends SvelteComponent {
4676
4844
  constructor(options) {
4677
4845
  super();
4678
- init(this, options, instance$c, create_fragment$c, safe_not_equal, { code: 0, _style: 1 }, add_css$b);
4846
+ init(this, options, instance$b, create_fragment$b, safe_not_equal, { code: 0, _style: 1 }, add_css$b);
4679
4847
  }
4680
4848
  }
4681
4849
 
@@ -4685,7 +4853,7 @@ function add_css$a(target) {
4685
4853
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4686
4854
  }
4687
4855
 
4688
- function create_fragment$b(ctx) {
4856
+ function create_fragment$a(ctx) {
4689
4857
  let div1;
4690
4858
  let div0;
4691
4859
 
@@ -4727,7 +4895,7 @@ function create_fragment$b(ctx) {
4727
4895
  };
4728
4896
  }
4729
4897
 
4730
- function instance$b($$self, $$props, $$invalidate) {
4898
+ function instance$a($$self, $$props, $$invalidate) {
4731
4899
  let $system;
4732
4900
  component_subscribe($$self, system, $$value => $$invalidate(12, $system = $$value));
4733
4901
  let { videoId = "sSgN-L4DU0c" } = $$props;
@@ -4906,8 +5074,8 @@ class MovieYouTubeElement extends SvelteComponent {
4906
5074
  init(
4907
5075
  this,
4908
5076
  options,
4909
- instance$b,
4910
- create_fragment$b,
5077
+ instance$a,
5078
+ create_fragment$a,
4911
5079
  safe_not_equal,
4912
5080
  {
4913
5081
  videoId: 2,
@@ -4928,7 +5096,7 @@ function add_css$9(target) {
4928
5096
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4929
5097
  }
4930
5098
 
4931
- function create_fragment$a(ctx) {
5099
+ function create_fragment$9(ctx) {
4932
5100
  let div1;
4933
5101
  let div0;
4934
5102
 
@@ -4970,7 +5138,7 @@ function create_fragment$a(ctx) {
4970
5138
  };
4971
5139
  }
4972
5140
 
4973
- function instance$a($$self, $$props, $$invalidate) {
5141
+ function instance$9($$self, $$props, $$invalidate) {
4974
5142
  let $system;
4975
5143
  component_subscribe($$self, system, $$value => $$invalidate(12, $system = $$value));
4976
5144
  let { videoId = "201239468" } = $$props;
@@ -5113,8 +5281,8 @@ class MovieVimeoElement extends SvelteComponent {
5113
5281
  init(
5114
5282
  this,
5115
5283
  options,
5116
- instance$a,
5117
- create_fragment$a,
5284
+ instance$9,
5285
+ create_fragment$9,
5118
5286
  safe_not_equal,
5119
5287
  {
5120
5288
  videoId: 2,
@@ -5129,112 +5297,13 @@ class MovieVimeoElement extends SvelteComponent {
5129
5297
  }
5130
5298
  }
5131
5299
 
5132
- /** @internal */
5133
- function registerInput({ name, statePath, validator = () => true, initialValue, }) {
5134
- const writableValue = {
5135
- subscribe(run) {
5136
- return formData.subscribe(formData => {
5137
- run(formData[name]?.value);
5138
- });
5139
- },
5140
- set(value) {
5141
- formData.update(prev => ({
5142
- ...prev,
5143
- [name]: {
5144
- statePath,
5145
- value,
5146
- isValid: validator(value),
5147
- },
5148
- }));
5149
- },
5150
- update(updater) {
5151
- formData.update(prev => {
5152
- const prevValue = prev[name]?.value;
5153
- return {
5154
- ...prev,
5155
- [name]: {
5156
- statePath,
5157
- value: updater(prevValue),
5158
- isValid: validator(prevValue),
5159
- },
5160
- };
5161
- });
5162
- },
5163
- };
5164
- writableValue.set(initialValue);
5165
- return writableValue;
5166
- }
5167
- /** @internal */
5168
- function deleteValues(statePath) {
5169
- formData.update(prev => {
5170
- const targetNames = Object.entries(prev)
5171
- .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
5172
- .map(([name]) => name);
5173
- targetNames.forEach(name => {
5174
- delete prev[name];
5175
- });
5176
- return { ...prev };
5177
- });
5178
- }
5179
- /** @internal */
5180
- const getValuesAreValidReader = statePath => ({
5181
- subscribe(callback) {
5182
- return formData.subscribe(formData => {
5183
- const valuesAreValid = Object.entries(formData)
5184
- .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
5185
- .every(([_, { isValid }]) => isValid); // eslint-disable-line @typescript-eslint/no-unused-vars
5186
- callback(valuesAreValid);
5187
- });
5188
- },
5189
- });
5190
- function formDataToEventValues(campaignId, formData) {
5191
- const questions = [];
5192
- const answersMap = {};
5193
- Object.entries(formData).forEach(([name, dataItem]) => {
5194
- questions.push(name);
5195
- const value = dataItem.value;
5196
- const answerKey = `question_${name}`;
5197
- if (Array.isArray(value)) {
5198
- answersMap[answerKey] = {
5199
- choices: value,
5200
- };
5201
- }
5202
- else if (typeof value === 'string') {
5203
- answersMap[answerKey] = {
5204
- free_answer: value,
5205
- };
5206
- }
5207
- });
5208
- return {
5209
- [campaignId]: {
5210
- questions,
5211
- ...answersMap,
5212
- },
5213
- };
5214
- }
5215
- /** @internal */
5216
- function submit() {
5217
- const systemConfig = getSystem();
5218
- const campaignId = systemConfig.campaignId;
5219
- if (campaignId) {
5220
- const formData$1 = get(formData);
5221
- const values = formDataToEventValues(campaignId, formData$1);
5222
- send_event('_answer_question', values);
5223
- }
5224
- {
5225
- const formData$1 = get(formData);
5226
- const values = formDataToEventValues('mock', formData$1);
5227
- console.log('values: ', values);
5228
- }
5229
- }
5230
-
5231
5300
  /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
5232
5301
 
5233
5302
  function add_css$8(target) {
5234
5303
  append_styles(target, "svelte-kyay3k", ".textarea-wrapper.svelte-kyay3k{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-kyay3k{width:100%;resize:none}");
5235
5304
  }
5236
5305
 
5237
- function create_fragment$9(ctx) {
5306
+ function create_fragment$8(ctx) {
5238
5307
  let div;
5239
5308
  let textarea;
5240
5309
  let mounted;
@@ -5304,7 +5373,7 @@ function create_fragment$9(ctx) {
5304
5373
  };
5305
5374
  }
5306
5375
 
5307
- function instance$9($$self, $$props, $$invalidate) {
5376
+ function instance$8($$self, $$props, $$invalidate) {
5308
5377
  let $value;
5309
5378
  let { name = '' } = $$props;
5310
5379
  let { required = true } = $$props;
@@ -5345,8 +5414,8 @@ class FormTextarea extends SvelteComponent {
5345
5414
  init(
5346
5415
  this,
5347
5416
  options,
5348
- instance$9,
5349
- create_fragment$9,
5417
+ instance$8,
5418
+ create_fragment$8,
5350
5419
  safe_not_equal,
5351
5420
  {
5352
5421
  name: 6,
@@ -5359,121 +5428,6 @@ class FormTextarea extends SvelteComponent {
5359
5428
  }
5360
5429
  }
5361
5430
 
5362
- /* src/components/FormButton.svelte generated by Svelte v3.53.1 */
5363
-
5364
- function create_fragment$8(ctx) {
5365
- let input;
5366
- let mounted;
5367
- let dispose;
5368
-
5369
- return {
5370
- c() {
5371
- input = element("input");
5372
- this.h();
5373
- },
5374
- l(nodes) {
5375
- input = claim_element(nodes, "INPUT", { type: true, style: true });
5376
- this.h();
5377
- },
5378
- h() {
5379
- attr(input, "type", "button");
5380
- set_style(input, "width", "100%");
5381
- set_style(input, "height", "100%");
5382
- input.value = /*text*/ ctx[0];
5383
- input.disabled = /*disabled*/ ctx[1];
5384
- },
5385
- m(target, anchor) {
5386
- insert_hydration(target, input, anchor);
5387
-
5388
- if (!mounted) {
5389
- dispose = listen(input, "click", /*handleClick*/ ctx[2]);
5390
- mounted = true;
5391
- }
5392
- },
5393
- p(ctx, [dirty]) {
5394
- if (dirty & /*text*/ 1) {
5395
- input.value = /*text*/ ctx[0];
5396
- }
5397
-
5398
- if (dirty & /*disabled*/ 2) {
5399
- input.disabled = /*disabled*/ ctx[1];
5400
- }
5401
- },
5402
- i: noop,
5403
- o: noop,
5404
- d(detaching) {
5405
- if (detaching) detach(input);
5406
- mounted = false;
5407
- dispose();
5408
- }
5409
- };
5410
- }
5411
-
5412
- function instance$8($$self, $$props, $$invalidate) {
5413
- let disabled;
5414
- let $valuesAreValid;
5415
- let { text = '' } = $$props;
5416
- let { onClick = { operation: 'submit', args: ['/'] } } = $$props;
5417
- const { path: statePath } = getStateItemContext();
5418
-
5419
- function handleClick() {
5420
- switch (onClick.operation) {
5421
- case 'submit':
5422
- {
5423
- if ($valuesAreValid) {
5424
- submit();
5425
- const stateId = onClick.args[0];
5426
- setState$1(stateId);
5427
- }
5428
-
5429
- break;
5430
- }
5431
- case 'next':
5432
- {
5433
- if ($valuesAreValid) {
5434
- const stateId = onClick.args[0];
5435
- setState$1(stateId);
5436
- }
5437
-
5438
- break;
5439
- }
5440
- case 'prev':
5441
- {
5442
- deleteValues(statePath);
5443
- const stateId = onClick.args[0];
5444
- setState$1(stateId);
5445
- break;
5446
- }
5447
- }
5448
- }
5449
-
5450
- const valuesAreValid = getValuesAreValidReader(statePath);
5451
- component_subscribe($$self, valuesAreValid, value => $$invalidate(5, $valuesAreValid = value));
5452
-
5453
- $$self.$$set = $$props => {
5454
- if ('text' in $$props) $$invalidate(0, text = $$props.text);
5455
- if ('onClick' in $$props) $$invalidate(4, onClick = $$props.onClick);
5456
- };
5457
-
5458
- $$self.$$.update = () => {
5459
- if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 48) {
5460
- $$invalidate(1, disabled = (() => {
5461
- const enabled = onClick.operation === 'prev' || $valuesAreValid;
5462
- return !enabled;
5463
- })());
5464
- }
5465
- };
5466
-
5467
- return [text, disabled, handleClick, valuesAreValid, onClick, $valuesAreValid];
5468
- }
5469
-
5470
- class FormButton extends SvelteComponent {
5471
- constructor(options) {
5472
- super();
5473
- init(this, options, instance$8, create_fragment$8, safe_not_equal, { text: 0, onClick: 4 });
5474
- }
5475
- }
5476
-
5477
5431
  /* src/components/FormRadioButtons.svelte generated by Svelte v3.53.1 */
5478
5432
 
5479
5433
  function add_css$7(target) {
@@ -5482,17 +5436,19 @@ function add_css$7(target) {
5482
5436
 
5483
5437
  function get_each_context$3(ctx, list, i) {
5484
5438
  const child_ctx = ctx.slice();
5485
- child_ctx[7] = list[i];
5486
- child_ctx[9] = i;
5439
+ child_ctx[8] = list[i];
5440
+ child_ctx[10] = i;
5487
5441
  return child_ctx;
5488
5442
  }
5489
5443
 
5490
- // (23:2) {#each _options as option, i}
5444
+ // (24:2) {#each _options as option, i}
5491
5445
  function create_each_block$3(ctx) {
5492
5446
  let label;
5493
5447
  let input;
5448
+ let input_value_value;
5449
+ let input_checked_value;
5494
5450
  let t0;
5495
- let t1_value = /*option*/ ctx[7] + "";
5451
+ let t1_value = /*option*/ ctx[8] + "";
5496
5452
  let t1;
5497
5453
  let t2;
5498
5454
  let mounted;
@@ -5520,7 +5476,8 @@ function create_each_block$3(ctx) {
5520
5476
  h() {
5521
5477
  attr(input, "type", "radio");
5522
5478
  attr(input, "name", /*name*/ ctx[0]);
5523
- input.value = /*$value*/ ctx[2];
5479
+ input.value = input_value_value = /*option*/ ctx[8];
5480
+ input.checked = input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1];
5524
5481
  },
5525
5482
  m(target, anchor) {
5526
5483
  insert_hydration(target, label, anchor);
@@ -5530,7 +5487,7 @@ function create_each_block$3(ctx) {
5530
5487
  append_hydration(label, t2);
5531
5488
 
5532
5489
  if (!mounted) {
5533
- dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[9]));
5490
+ dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[10]));
5534
5491
  mounted = true;
5535
5492
  }
5536
5493
  },
@@ -5541,11 +5498,15 @@ function create_each_block$3(ctx) {
5541
5498
  attr(input, "name", /*name*/ ctx[0]);
5542
5499
  }
5543
5500
 
5544
- if (dirty & /*$value*/ 4) {
5545
- input.value = /*$value*/ ctx[2];
5501
+ if (dirty & /*_options*/ 4 && input_value_value !== (input_value_value = /*option*/ ctx[8])) {
5502
+ input.value = input_value_value;
5503
+ }
5504
+
5505
+ if (dirty & /*_options, _value*/ 6 && input_checked_value !== (input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1])) {
5506
+ input.checked = input_checked_value;
5546
5507
  }
5547
5508
 
5548
- if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[7] + "")) set_data(t1, t1_value);
5509
+ if (dirty & /*_options*/ 4 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
5549
5510
  },
5550
5511
  d(detaching) {
5551
5512
  if (detaching) detach(label);
@@ -5557,7 +5518,7 @@ function create_each_block$3(ctx) {
5557
5518
 
5558
5519
  function create_fragment$7(ctx) {
5559
5520
  let div;
5560
- let each_value = /*_options*/ ctx[1];
5521
+ let each_value = /*_options*/ ctx[2];
5561
5522
  let each_blocks = [];
5562
5523
 
5563
5524
  for (let i = 0; i < each_value.length; i += 1) {
@@ -5596,8 +5557,8 @@ function create_fragment$7(ctx) {
5596
5557
  }
5597
5558
  },
5598
5559
  p(ctx, [dirty]) {
5599
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
5600
- each_value = /*_options*/ ctx[1];
5560
+ if (dirty & /*_options, name, _value, handleChange*/ 23) {
5561
+ each_value = /*_options*/ ctx[2];
5601
5562
  let i;
5602
5563
 
5603
5564
  for (i = 0; i < each_value.length; i += 1) {
@@ -5630,6 +5591,7 @@ function create_fragment$7(ctx) {
5630
5591
 
5631
5592
  function instance$7($$self, $$props, $$invalidate) {
5632
5593
  let _options;
5594
+ let _value;
5633
5595
  let $value;
5634
5596
  let { name = '' } = $$props;
5635
5597
  let { options = 'ラジオボタン1,ラジオボタン2,ラジオボタン3' } = $$props;
@@ -5644,7 +5606,7 @@ function instance$7($$self, $$props, $$invalidate) {
5644
5606
  }
5645
5607
  });
5646
5608
 
5647
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
5609
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
5648
5610
 
5649
5611
  const handleChange = index => event => {
5650
5612
  if (event.target.checked) {
@@ -5659,11 +5621,15 @@ function instance$7($$self, $$props, $$invalidate) {
5659
5621
 
5660
5622
  $$self.$$.update = () => {
5661
5623
  if ($$self.$$.dirty & /*options*/ 32) {
5662
- $$invalidate(1, _options = options.split(','));
5624
+ $$invalidate(2, _options = options.split(','));
5625
+ }
5626
+
5627
+ if ($$self.$$.dirty & /*$value*/ 64) {
5628
+ $$invalidate(1, _value = $value[0]);
5663
5629
  }
5664
5630
  };
5665
5631
 
5666
- return [name, _options, $value, value, handleChange, options];
5632
+ return [name, _value, _options, value, handleChange, options, $value];
5667
5633
  }
5668
5634
 
5669
5635
  class FormRadioButtons extends SvelteComponent {
@@ -5940,6 +5906,7 @@ function get_each_context$1(ctx, list, i) {
5940
5906
  function create_each_block$1(ctx) {
5941
5907
  let label;
5942
5908
  let input;
5909
+ let input_checked_value;
5943
5910
  let t0;
5944
5911
  let t1_value = /*option*/ ctx[8] + "";
5945
5912
  let t1;
@@ -5969,7 +5936,7 @@ function create_each_block$1(ctx) {
5969
5936
  h() {
5970
5937
  attr(input, "type", "checkbox");
5971
5938
  attr(input, "name", /*name*/ ctx[0]);
5972
- input.value = /*$value*/ ctx[2];
5939
+ input.checked = input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]];
5973
5940
  },
5974
5941
  m(target, anchor) {
5975
5942
  insert_hydration(target, label, anchor);
@@ -5990,8 +5957,8 @@ function create_each_block$1(ctx) {
5990
5957
  attr(input, "name", /*name*/ ctx[0]);
5991
5958
  }
5992
5959
 
5993
- if (dirty & /*$value*/ 4) {
5994
- input.value = /*$value*/ ctx[2];
5960
+ if (dirty & /*isCheckedArray*/ 4 && input_checked_value !== (input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]])) {
5961
+ input.checked = input_checked_value;
5995
5962
  }
5996
5963
 
5997
5964
  if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
@@ -6045,7 +6012,7 @@ function create_fragment$5(ctx) {
6045
6012
  }
6046
6013
  },
6047
6014
  p(ctx, [dirty]) {
6048
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
6015
+ if (dirty & /*_options, name, isCheckedArray, handleChange*/ 23) {
6049
6016
  each_value = /*_options*/ ctx[1];
6050
6017
  let i;
6051
6018
 
@@ -6094,12 +6061,12 @@ function instance$5($$self, $$props, $$invalidate) {
6094
6061
  }
6095
6062
  });
6096
6063
 
6097
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
6064
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
6098
6065
 
6099
6066
  const handleChange = index => event => {
6100
6067
  if (isCheckedArray[index] !== event.target.checked) {
6101
- isCheckedArray[index] = event.target.checked;
6102
- isCheckedArray = [...isCheckedArray];
6068
+ $$invalidate(2, isCheckedArray[index] = event.target.checked, isCheckedArray);
6069
+ $$invalidate(2, isCheckedArray = [...isCheckedArray]);
6103
6070
  const updated = _options.filter((option, i) => isCheckedArray[i]);
6104
6071
  value.set(updated);
6105
6072
  }
@@ -6115,15 +6082,15 @@ function instance$5($$self, $$props, $$invalidate) {
6115
6082
  $$invalidate(1, _options = options.split(','));
6116
6083
  }
6117
6084
 
6118
- if ($$self.$$.dirty & /*$value, _options*/ 6) {
6119
- isCheckedArray = (() => {
6085
+ if ($$self.$$.dirty & /*$value, _options*/ 66) {
6086
+ $$invalidate(2, isCheckedArray = (() => {
6120
6087
  const checkedSet = new Set($value);
6121
6088
  return _options.map(option => checkedSet.has(option));
6122
- })();
6089
+ })());
6123
6090
  }
6124
6091
  };
6125
6092
 
6126
- return [name, _options, $value, value, handleChange, options];
6093
+ return [name, _options, isCheckedArray, value, handleChange, options, $value];
6127
6094
  }
6128
6095
 
6129
6096
  class FormCheckBoxes extends SvelteComponent {
@@ -7487,4 +7454,4 @@ class ImageBlock extends SvelteComponent {
7487
7454
  }
7488
7455
  }
7489
7456
 
7490
- export { Alignments, AnimationStyles, BackgroundSizes, ClipPaths, Cursors, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, EmbedElement, Flex, FlexItem, FormButton, FormCheckBoxes, FormOperationOptions, FormRadioButtons, FormSelect, FormTextarea, Grid, GridItem, GridModalState, ImageBlock, ImageElement, Justifies, KARTE_MODAL_ROOT, LengthUnits, List, ListBackgroundTypes, ListDirections, ListItem, ListSeparatorTypes, MediaQueries, Modal, ModalPositions, MovieVimeoElement, MovieYouTubeElement, ObjectFits, OnClickOperationOptions, Overflows, PropTypes, Repeats, Slide, SlideItem, State, StateItem, TextBlock, TextButtonBlock, TextButtonElement, TextDirections, TextElement, WritingModes, applyCss, applyGlobalCss, close, closeAction, closed, collection$1 as collection, create, createApp, createFog, customHandlers, customVariables, destroy, destroyed, ensureModalRoot, finalize, formData, getActionShadowRoot, getCustomHandlers, getCustomVariables, getState$1 as getState, getStates, getStoreState, getSystem, hideOnScroll, hideOnTime, initialize, isClosed, isOpened, loadGlobalScript, loadGlobalStyle, loadStyle, onChangeState, onClose, onCreate, onDestroy, onScroll, onShow, onTime, opened, setActionSetting, setAutoStart, setClosed, setCustomHandlers, setCustomVariables, setState$1 as setState, show, showAction, showModal, showOnScroll, showOnTime, state, stopped, updateCustomHandlers, updateCustomVariables, widget };
7457
+ export { Alignments, AnimationStyles, BackgroundSizes, ClipPaths, Cursors, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, EmbedElement, Flex, FlexItem, FormCheckBoxes, FormRadioButtons, FormSelect, FormTextarea, Grid, GridItem, GridModalState, ImageBlock, ImageElement, Justifies, KARTE_MODAL_ROOT, LengthUnits, List, ListBackgroundTypes, ListDirections, ListItem, ListSeparatorTypes, MediaQueries, Modal, ModalPositions, MovieVimeoElement, MovieYouTubeElement, ObjectFits, OnClickOperationOptions, Overflows, PropTypes, Repeats, Slide, SlideItem, State, StateItem, TextBlock, TextButtonBlock, TextButtonElement, TextDirections, TextElement, WritingModes, applyCss, applyGlobalCss, close, closeAction, closed, collection$1 as collection, create, createApp, createFog, customHandlers, customVariables, destroy, destroyed, ensureModalRoot, finalize, formData, getActionShadowRoot, getCustomHandlers, getCustomVariables, getState$1 as getState, getStates, getStoreState, getSystem, hideOnScroll, hideOnTime, initialize, isClosed, isOpened, loadGlobalScript, loadGlobalStyle, loadStyle, onChangeState, onClose, onCreate, onDestroy, onScroll, onShow, onTime, opened, setActionSetting, setAutoStart, setClosed, setCustomHandlers, setCustomVariables, setState$1 as setState, show, showAction, showModal, showOnScroll, showOnTime, state, stopped, updateCustomHandlers, updateCustomVariables, widget };