@yoopta/editor 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"BlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/BlockActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAuBjF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,QAAA,MAAM,YAAY,yEAA0E,YAAY,4CAoIvG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"BlockActions.d.ts","sourceRoot":"","sources":["../../../src/components/Block/BlockActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAuBjF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,eAAe,EAAE,GAAG,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,QAAA,MAAM,YAAY,yEAA0E,YAAY,4CAyIvG,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { YooEditor, YooptaContentValue } from '../types';
2
+ export declare function setEditorValue(editor: YooEditor, value: YooptaContentValue): void;
3
+ //# sourceMappingURL=setEditorValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/setEditorValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGzD,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,QAK1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA2BpC,eAAO,MAAM,kBAAkB,QAAO,SAoCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AA4BpC,eAAO,MAAM,kBAAkB,QAAO,SAqCrC,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAgB,CAAC"}
@@ -71,6 +71,7 @@ export type YooEditor<TNodes = any> = {
71
71
  selectedBlocks: number[] | null;
72
72
  children: Record<string, YooptaBlockData>;
73
73
  getEditorValue: () => TNodes;
74
+ setEditorValue: (value: YooptaContentValue) => void;
74
75
  setSelection: (path: YooptaBlockPath | null, options?: SetSelectionOptions) => void;
75
76
  setBlockSelected: (path: number[] | null, options?: BlockSelectedOptions) => void;
76
77
  blur: (options?: EditorBlurOptions) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,CAAC;AAEvC,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,UAAU,GAAG,YAAY,IAAI;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAGjC,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC;AAEnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAGjE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,GAAG,GAAG,CAAC;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,YAAY,SAAS,MAAM,EAAE,aAAa,EACxD,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,aAAa,KACxB,IAAI,CAAC;IACV,MAAM,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,YAAY,CAAC;AAGtD,MAAM,MAAM,SAAS,CAAC,MAAM,GAAG,GAAG,IAAI;IACpC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrF,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC1F,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAClE,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1E,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1D,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9D,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACpF,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClF,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,sBAAsB,CAAC;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,EAAE,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IACjE,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IACnE,GAAG,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IAClE,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAGF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,GAAG,IAAI;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/editor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,CAAC;AAEvC,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,UAAU,GAAG,YAAY,IAAI;IAC3D,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAGjC,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC;AAEnC,MAAM,MAAM,4BAA4B,GAAG;IACzC,EAAE,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAGjE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,GAAG,GAAG,CAAC;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC/C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,YAAY,SAAS,MAAM,EAAE,aAAa,EACxD,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,YAAY,EACzB,YAAY,EAAE,aAAa,KACxB,IAAI,CAAC;IACV,MAAM,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,YAAY,CAAC;AAGtD,MAAM,MAAM,SAAS,CAAC,MAAM,GAAG,GAAG,IAAI;IACpC,WAAW,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrF,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC1F,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC7D,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAClE,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpD,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAC3D,WAAW,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC1E,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,CAAC,OAAO,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;IACrE,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1D,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9D,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAClC,cAAc,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC1C,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,cAAc,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpD,YAAY,EAAE,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACpF,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClF,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,eAAe,EAAE,sBAAsB,CAAC;IACxC,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,EAAE,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IACjE,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IACnE,GAAG,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,CAAC;IAClE,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAGF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,GAAG,IAAI;IAC7D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,EAAE,UAAU,EAAE,GAAG,YAAY,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"onKeyDown.d.ts","sourceRoot":"","sources":["../../src/handlers/onKeyDown.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAyB1E,MAAM;AAEN,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAC1B,mBAAmB,UAsMnC"}
1
+ {"version":3,"file":"onKeyDown.d.ts","sourceRoot":"","sources":["../../src/handlers/onKeyDown.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,SAAS,EAAmB,MAAM,iBAAiB,CAAC;AAyB1E,MAAM;AAEN,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAC1B,mBAAmB,UA+MnC"}
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { findSlateBySelectionPath } from './utils/findSlateBySelectionPath';
11
11
  export { findPluginBlockByType } from './utils/findPluginBlockByType';
12
12
  export { createYooptaEditor } from './editor';
13
13
  export { createYooptaMark, YooptaMarkParams, YooptaMark } from './marks';
14
- export { YooEditor, SlateElement, YooptaBlockData, YooptaBlock } from './editor/types';
14
+ export { YooEditor, SlateElement, YooptaBlockData, YooptaBlock, YooptaContentValue } from './editor/types';
15
15
  export { buildBlockData, buildBlockElement } from './components/Editor/utils';
16
16
  export default YooptaEditor;
17
17
  export { PluginElementRenderProps, PluginEventHandlerOptions, PluginCustomEditorRenderProps, YooptaMarkProps, } from './plugins/types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,eAAe,YAAY,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9E,eAAe,YAAY,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,6BAA6B,EAC7B,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import*as n from"react";import r,{createContext as i,useContext as a,useRef as l,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as y,createElement as g}from"react";import*as v from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as O,DefaultElement as E,withReact as C}from"slate-react";import{Editor as S,Transforms as _,Path as D,Range as R,Text as j,Element as B,Operation as A,createEditor as T,Point as M}from"slate";class L{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:o}=e,n=Object.assign(Object.assign({},this.plugin.options),o),r=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const o=r[e];o&&o.render&&(r[e].render=o=>t[e](o))})),new L(Object.assign(Object.assign({},this.plugin),{elements:r,options:n}))}}function N(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));return r?e.children[r]:null}const I={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},P=i(I),F=({children:t,editorState:o})=>{const n=l(I);return n.current={editor:o.editor},e(P.Provider,Object.assign({value:n.current},{children:t}))},z=()=>{const e=a(P);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},H=e=>z().children[e],U=e=>z().blocks[e],V=e=>z().plugins[e],K=()=>z().readOnly,W=e=>{var t;return null===(t=V(e))||void 0===t?void 0:t.options},Y=({blockId:e,path:t})=>{var o;const n=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=n.children[e]),t&&(r=N(n,{at:t})),(null===(o=n.selection)||void 0===o?void 0:o[0])===(null==r?void 0:r.meta.order)};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}function r(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var l=new r(n,i||e,a),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],l]:e._events[c].push(l):(e._events[c]=l,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(o=!1)),l.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(o?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r<i;r++)a[r]=n[r].fn;return a},l.prototype.listenerCount=function(e){var t=o?o+e:e,n=this._events[t];return n?n.fn?1:n.length:0},l.prototype.emit=function(e,t,n,r,i,a){var l=o?o+e:e;if(!this._events[l])return!1;var c,s,d=this._events[l],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,i),!0;case 6:return d.fn.call(d.context,t,n,r,i,a),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,n);break;case 4:d[s].fn.call(d[s].context,t,n,r);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},l.prototype.on=function(e,t,o){return i(this,e,t,o,!1)},l.prototype.once=function(e,t,o){return i(this,e,t,o,!0)},l.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||r&&!l.once||n&&l.context!==n||a(this,i);else{for(var c=0,s=[],d=l.length;c<d;c++)(l[c].fn!==t||r&&!l[c].once||n&&l[c].context!==n)&&s.push(l[c]);s.length?this._events[i]=1===s.length?s[0]:s:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}({get exports(){return X},set exports(e){X=e}});var Z=X;function q(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?q():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function oe(e){return"nodeType"in e}function ne(e){var t,o;return e?te(e)?e:oe(e)&&null!=(t=null==(o=e.ownerDocument)?void 0:o.defaultView)?t:window:window}function re(e){const{Document:t}=ne(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof ne(e).HTMLElement}function ae(e){return e instanceof ne(e).SVGElement}function le(e){return e?te(e)?e.document:oe(e)?re(e)?e:ie(e)||ae(e)?e.ownerDocument:document:document:document}const ce=ee?c:s;function se(e){const t=l(e);return ce((()=>{t.current=e})),u((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}function de(e,t){void 0===t&&(t=[e]);const o=l(e);return ce((()=>{o.current!==e&&(o.current=e)}),t),o}function ue(e,t){const o=l();return d((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function fe(e){const t=se(e),o=l(null),n=u((e=>{e!==o.current&&(null==t||t(e,o.current)),o.current=e}),[]);return[o,n]}function pe(e){const t=l();return s((()=>{t.current=e}),[e]),t.current}let he={};function ye(e,t){return d((()=>{if(t)return t;const o=null==he[e]?0:he[e]+1;return he[e]=o,e+"-"+o}),[e,t])}function ge(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>{const n=Object.entries(o);for(const[o,r]of n){const n=t[o];null!=n&&(t[o]=n+e*r)}return t}),{...t})}}const ve=ge(1),me=ge(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=ne(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ne(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:o}=e.touches[0];return{x:t,y:o}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:o}=e.changedTouches[0];return{x:t,y:o}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const xe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:o}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:o}=e;return"scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:n}=e;return t+" "+o+"ms "+n}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oe(e){return e.matches(ke)?e:e.querySelector(ke)}const Ee={display:"none"};function Ce(e){let{id:t,value:o}=e;return r.createElement("div",{id:t,style:Ee},o)}function Se(e){let{id:t,announcement:o,ariaLiveType:n="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},o)}const _e=i(null);const De={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Re={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was moved over droppable area "+o.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was dropped over droppable area "+o.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function je(e){let{announcements:t=Re,container:o,hiddenTextDescribedById:n,screenReaderInstructions:i=De}=e;const{announce:l,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ye("DndLiveRegion"),[h,y]=f(!1);if(s((()=>{y(!0)}),[]),function(e){const t=a(_e);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:o}=e;l(t.onDragStart({active:o}))},onDragMove(e){let{active:o,over:n}=e;t.onDragMove&&l(t.onDragMove({active:o,over:n}))},onDragOver(e){let{active:o,over:n}=e;l(t.onDragOver({active:o,over:n}))},onDragEnd(e){let{active:o,over:n}=e;l(t.onDragEnd({active:o,over:n}))},onDragCancel(e){let{active:o,over:n}=e;l(t.onDragCancel({active:o,over:n}))}})),[l,t])),!h)return null;const g=r.createElement(r.Fragment,null,r.createElement(Ce,{id:n,value:i.draggable}),r.createElement(Se,{id:p,announcement:c}));return o?b(g,o):g}var Be;function Ae(){}function Te(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Be||(Be={}));const Me=Object.freeze({x:0,y:0});function Le(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ne(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return o-n}function Ie(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return n-o}function Pe(e){let{left:t,top:o,height:n,width:r}=e;return[{x:t,y:o},{x:t+r,y:o},{x:t,y:o+n},{x:t+r,y:o+n}]}function Fe(e,t){if(!e||0===e.length)return null;const[o]=e;return t?o[t]:o}function ze(e,t,o){return void 0===t&&(t=e.left),void 0===o&&(o=e.top),{x:t+.5*e.width,y:o+.5*e.height}}const He=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=ze(t,t.left,t.top),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Le(ze(n),r);i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(Ne)};function Ue(e,t){const o=Math.max(t.top,e.top),n=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-n,l=i-o;if(n<r&&o<i){const o=t.width*t.height,n=e.width*e.height,r=a*l;return Number((r/(o+n-r)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=[];for(const e of n){const{id:n}=e,i=o.get(n);if(i){const o=Ue(i,t);o>0&&r.push({id:n,data:{droppableContainer:e,value:o}})}}return r.sort(Ie)};function Ke(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function We(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>({...t,top:t.top+e*o.y,bottom:t.bottom+e*o.y,left:t.left+e*o.x,right:t.right+e*o.x})),{...t})}}const Ye=We(1);const $e={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=$e);let o=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=ne(e).getComputedStyle(e);t&&(o=function(e,t,o){const n=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!n)return e;const{scaleX:r,scaleY:i,x:a,y:l}=n,c=e.left-a-(1-r)*parseFloat(o),s=e.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(o,t,n))}const{top:n,left:r,width:i,height:a,bottom:l,right:c}=o;return{top:n,left:r,width:i,height:a,bottom:l,right:c}}function Ze(e){return Xe(e,{ignoreTransform:!0})}function qe(e,t){const o=[];return e?function n(r){if(null!=t&&o.length>=t)return o;if(!r)return o;if(re(r)&&null!=r.scrollingElement&&!o.includes(r.scrollingElement))return o.push(r.scrollingElement),o;if(!ie(r)||ae(r))return o;if(o.includes(r))return o;const i=ne(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=ne(e).getComputedStyle(e));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const n=t[e];return"string"==typeof n&&o.test(n)}))}(r,i)&&o.push(r),function(e,t){return void 0===t&&(t=ne(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?o:n(r.parentNode)}(e):o}function Ge(e){const[t]=qe(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:oe(e)?re(e)||e===le(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var ot;function nt(e){return!(!ee||!e)&&e===document.scrollingElement}function rt(e){const t={x:0,y:0},o=nt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ot||(ot={}));const it={x:.2,y:.2};function at(e,t,o,n,r){let{top:i,left:a,right:l,bottom:c}=o;void 0===n&&(n=10),void 0===r&&(r=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=rt(e),p={x:0,y:0},h={x:0,y:0},y=t.height*r.y,g=t.width*r.x;return!s&&i<=t.top+y?(p.y=ot.Backward,h.y=n*Math.abs((t.top+y-i)/y)):!d&&c>=t.bottom-y&&(p.y=ot.Forward,h.y=n*Math.abs((t.bottom-y-c)/y)),!f&&l>=t.right-g?(p.x=ot.Forward,h.x=n*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(p.x=ot.Backward,h.x=n*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function lt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:o,right:n,bottom:r}=e.getBoundingClientRect();return{top:t,left:o,right:n,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ct(e){return e.reduce(((e,t)=>ve(e,tt(t))),Me)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=qe(t),n=ct(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(o),a=n[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,o){var n;null==(n=this.target)||n.addEventListener(e,t,o),this.listeners.push([e,t,o])}}function ft(e,t){const o=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(o**2+n**2)>t:"x"in t&&"y"in t?o>t.x&&n>t.y:"x"in t?o>t.x:"y"in t&&n>t.y}var pt,ht;function yt(e){e.preventDefault()}function gt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const vt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:o}=t;switch(e.code){case ht.Right:return{...o,x:o.x+25};case ht.Left:return{...o,x:o.x-25};case ht.Down:return{...o,y:o.y+25};case ht.Up:return{...o,y:o.y-25}}};class bt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ut(le(t)),this.windowListeners=new ut(ne(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,o=e.node.current;o&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:o,left:n,bottom:r,right:i}=t(e);Ge(e)&&(r<=0||i<=0||o>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(o),t(Me)}handleKeyDown(e){if(be(e)){const{active:t,context:o,options:n}=this.props,{keyboardCodes:r=vt,coordinateGetter:i=mt,scrollBehavior:a="smooth"}=n,{code:l}=e;if(r.end.includes(l))return void this.handleEnd(e);if(r.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=o.current,s=c?{x:c.left,y:c.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:o.current,currentCoordinates:s});if(d){const t=me(d,s),n={x:0,y:0},{scrollableAncestors:r}=o.current;for(const o of r){const r=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=rt(o),p=lt(o),h={x:Math.min(r===ht.Right?p.right-p.width/2:p.right,Math.max(r===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(r===ht.Down?p.top:p.top+p.height/2,d.y))},y=r===ht.Right&&!l||r===ht.Left&&!c,g=r===ht.Down&&!s||r===ht.Up&&!i;if(y&&h.x!==d.x){const e=o.scrollLeft+t.x,i=r===ht.Right&&e<=u.x||r===ht.Left&&e>=f.x;if(i&&!t.y)return void o.scrollTo({left:e,behavior:a});n.x=i?o.scrollLeft-e:r===ht.Right?o.scrollLeft-u.x:o.scrollLeft-f.x,n.x&&o.scrollBy({left:-n.x,behavior:a});break}if(g&&h.y!==d.y){const e=o.scrollTop+t.y,i=r===ht.Down&&e<=u.y||r===ht.Up&&e>=f.y;if(i&&!t.x)return void o.scrollTo({top:e,behavior:a});n.y=i?o.scrollTop-e:r===ht.Down?o.scrollTop-u.y:o.scrollTop-f.y,n.y&&o.scrollBy({top:-n.y,behavior:a});break}}this.handleMove(e,ve(me(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:o}=this.props;e.preventDefault(),o(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,o)=>{let{keyboardCodes:n=vt,onActivation:r}=t,{active:i}=o;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,o){var n;void 0===o&&(o=function(e){const{EventTarget:t}=ne(e);return e instanceof t?e:le(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=le(i),this.documentListeners=new ut(this.document),this.listeners=new ut(o),this.windowListeners=new ut(ne(i)),this.initialCoordinates=null!=(n=we(r))?n:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,yt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,yt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=o&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,gt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:o,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;const l=null!=(t=we(e))?t:Me,c=me(n,l);if(!o&&a){if(wt(a)){if(null!=a.tolerance&&ft(c,a.tolerance))return this.handleCancel();if(ft(c,a.distance))return this.handleStart()}return xt(a)&&ft(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Ot={move:{name:"pointermove"},end:{name:"pointerup"}};class Et extends kt{constructor(e){const{event:t}=e,o=le(t.target);super(e,Ot,o)}}Et.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return!(!o.isPrimary||0!==o.button)&&(null==n||n({event:o}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Ct,le(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return o.button!==St.RightClick&&(null==n||n({event:o}),!0)}}];const _t={move:{name:"touchmove"},end:{name:"touchend"}};var Dt,Rt;function jt(e){let{acceleration:t,activator:o=Dt.Pointer,canScroll:n,draggingRect:r,enabled:i,interval:a=5,order:c=Rt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:y,threshold:g}=e;const v=function(e){let{delta:t,disabled:o}=e;const n=pe(t);return ue((e=>{if(o||!n||!e)return Bt;const r={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:e.x[ot.Backward]||-1===r.x,[ot.Forward]:e.x[ot.Forward]||1===r.x},y:{[ot.Backward]:e.y[ot.Backward]||-1===r.y,[ot.Forward]:e.y[ot.Forward]||1===r.y}}}),[o,t,n])}({delta:y,disabled:!i}),[m,b]=function(){const e=l(null);return[u(((t,o)=>{e.current=setInterval(t,o)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=l({x:0,y:0}),x=l({x:0,y:0}),k=d((()=>{switch(o){case Dt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Dt.DraggableRect:return r}}),[o,r,f]),O=l(null),E=u((()=>{const e=O.current;if(!e)return;const t=w.current.x*x.current.x,o=w.current.y*x.current.y;e.scrollBy(t,o)}),[]),C=d((()=>c===Rt.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of C){if(!1===(null==n?void 0:n(e)))continue;const o=p.indexOf(e),r=h[o];if(!r)continue;const{direction:i,speed:l}=at(e,r,k,t,g);for(const e of["x","y"])v[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return b(),O.current=e,m(E,a),w.current=l,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,E,n,b,i,a,JSON.stringify(k),JSON.stringify(v),m,p,C,h,JSON.stringify(g)])}(class extends kt{constructor(e){super(e,_t)}static setup(){return window.addEventListener(_t.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(_t.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;const{touches:r}=o;return!(r.length>1)&&(null==n||n({event:o}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Dt||(Dt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Rt||(Rt={}));const Bt={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};var At,Tt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Tt||(Tt={}));const Mt=new Map;function Lt(e,t){return ue((o=>e?o||("function"==typeof t?t(e):e):null),[t,e])}function Nt(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(n)}),[o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function It(e){return new dt(Xe(e),e)}function Pt(e,t,o){void 0===t&&(t=It);const[n,r]=h((function(n){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=n?n:o)?r:null;const i=t(e);if(JSON.stringify(n)===JSON.stringify(i))return n;return i}),null),i=function(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(n)}),[n,o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const o of t){const{type:t,target:n}=o;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){r();break}}}}),a=Nt({callback:r});return ce((()=>{r(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),n}const Ft=[];function zt(e,t){void 0===t&&(t=[]);const o=l(null);return s((()=>{o.current=null}),t),s((()=>{const t=e!==Me;t&&!o.current&&(o.current=e),!t&&o.current&&(o.current=null)}),[e]),o.current?me(e,o.current):Me}function Ht(e){return d((()=>e?function(e){const t=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:t,bottom:o,width:t,height:o}}(e):null),[e])}const Ut=[];function Vt(e){let{measure:t}=e;const[o,n]=f(null),r=u((e=>{for(const{target:o}of e)if(ie(o)){n((e=>{const n=t(o);return e?{...e,width:n.width,height:n.height}:n}));break}}),[t]),i=Nt({callback:r}),a=u((e=>{const o=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),o&&(null==i||i.observe(o)),n(o?t(o):null)}),[t,i]),[l,c]=fe(a);return d((()=>({nodeRef:l,rect:o,setRef:c})),[o,l,c])}const Kt=[{sensor:Et,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Yt={draggable:{measure:Ze},droppable:{measure:Ze,strategy:At.WhileDragging,frequency:Tt.Optimized},dragOverlay:{measure:Xe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,o;return null!=(t=null==(o=this.get(e))?void 0:o.node.current)?t:void 0}}const Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},Zt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),qt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Jt(e,t){switch(t.type){case Be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Be.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Be.DragEnd:case Be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Be.RegisterDroppable:{const{element:o}=t,{id:n}=o,r=new $t(e.droppable.containers);return r.set(n,o),{...e,droppable:{...e.droppable,containers:r}}}case Be.SetDroppableDisabled:{const{id:o,key:n,disabled:r}=t,i=e.droppable.containers.get(o);if(!i||n!==i.key)return e;const a=new $t(e.droppable.containers);return a.set(o,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case Be.UnregisterDroppable:{const{id:o,key:n}=t,r=e.droppable.containers.get(o);if(!r||n!==r.key)return e;const i=new $t(e.droppable.containers);return i.delete(o),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:o,activatorEvent:n,draggableNodes:r}=a(Zt),i=pe(n),l=pe(null==o?void 0:o.id);return s((()=>{if(!t&&!n&&i&&null!=l){if(!be(i))return;if(document.activeElement===i.target)return;const e=r.get(l);if(!e)return;const{activatorNode:t,node:o}=e;if(!t.current&&!o.current)return;requestAnimationFrame((()=>{for(const e of[t.current,o.current]){if(!e)continue;const t=Oe(e);if(t){t.focus();break}}}))}}),[n,t,r,l,i]),null}const eo=i({...Me,scaleX:1,scaleY:1});var to;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(to||(to={}));const oo=p((function(e){var t,o,n,i;let{id:a,accessibility:c,autoScroll:p=!0,children:y,sensors:g=Kt,collisionDetection:v=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[O,E]=k,[C,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:o,event:n}=t;e.forEach((e=>{var t;return null==(t=e[o])?void 0:t.call(e,n)}))}),[e]),t]}(),[_,D]=f(to.Uninitialized),R=_===to.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=O,M=j?B.get(j):null,L=l({initial:null,translated:null}),N=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Wt,rect:L}:null}),[j,M]),I=l(null),[P,F]=f(null),[z,H]=f(null),U=de(x,Object.values(x)),V=ye("DndDescribedBy",a),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Yt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Yt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Yt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:o,dependencies:n,config:r}=t;const[i,a]=f(null),{frequency:c,measure:d,strategy:p}=r,h=l(e),y=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return o;default:return!o}}(),g=de(y),v=u((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),m=l(null),b=ue((t=>{if(y&&!o)return Mt;if(!t||t===Mt||h.current!==e||null!=i){const t=new Map;for(let o of e){if(!o)continue;if(i&&i.length>0&&!i.includes(o.id)&&o.rect.current){t.set(o.id,o.rect.current);continue}const e=o.node.current,n=e?new dt(d(e),e):null;o.rect.current=n,n&&t.set(o.id,n)}return t}return t}),[e,i,o,y,d]);return s((()=>{h.current=e}),[e]),s((()=>{y||v()}),[o,y]),s((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),s((()=>{y||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{v(),m.current=null}),c))}),[c,y,v,...n]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=i}}(K,{dragging:R,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const o=null!==t?e.get(t):void 0,n=o?o.node.current:null;return ue((e=>{var o;return null===t?null:null!=(o=null!=n?n:e)?o:null}),[n,t])}(B,j),G=d((()=>z?we(z):null),[z]),J=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,o=R&&!e&&!t;if("object"==typeof p)return{...p,enabled:o};return{enabled:o}}(),Q=function(e,t){return Lt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:o,initialRect:n,config:r=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof r?{x:r,y:r}:r;ce((()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!n)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Ke(o(e),n);if(a||(r.x=0),c||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ge(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,c,n,o])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=Pt(q,W.draggable.measure,Q),oe=Pt(q?q.parentElement:null),re=l({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=re.current.over)?void 0:t.id),ae=Vt({measure:W.dragOverlay.measure}),le=null!=(o=ae.nodeRef.current)?o:q,se=R?null!=(n=ae.rect)?n:te:null,fe=Boolean(ae.nodeRef.current&&ae.rect),pe=Ke(he=fe?null:te,Lt(he));var he;const ge=Ht(le?ne(le):null),me=function(e){const t=l(e),o=ue((o=>e?o&&o!==Ft&&e&&t.current&&e.parentNode===t.current.parentNode?o:qe(e):Ft),[e]);return s((()=>{t.current=e}),[e]),o}(R?null!=ie?ie:q:null),be=function(e,t){void 0===t&&(t=Xe);const[o]=e,n=Ht(o?ne(o):null),[r,i]=h((function(){return e.length?e.map((e=>nt(e)?n:new dt(t(e),e))):Ut}),Ut),a=Nt({callback:i});return e.length>0&&r===Ut&&i(),ce((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:o,...n}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...n})),o):o}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:z,active:N,activeNodeRect:te,containerNodeRect:oe,draggingNodeRect:se,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ge}),ke=G?ve(G,A):null,Oe=function(e){const[t,o]=f(null),n=l(e),r=u((e=>{const t=Je(e.target);t&&o((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=n.current;if(e!==t){i(t);const a=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));o(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ve(e,t)),Me):ct(e):Me),[e,t])}(me),Ee=zt(Oe),Ce=zt(Oe,[te]),Se=ve(xe,Ee),De=se?Ye(se,xe):null,Re=N&&De?v({active:N,collisionRect:De,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Fe(Re,"id"),[Te,Le]=f(null),Ne=function(e,t,o){return{...e,scaleX:t&&o?t.width/o.width:1,scaleY:t&&o?t.height/o.height:1}}(fe?xe:ve(xe,Ce),null!=(i=null==Te?void 0:Te.rect)?i:null,te),Ie=u(((e,t)=>{let{sensor:o,options:n}=t;if(null==I.current)return;const r=B.get(I.current);if(!r)return;const i=e.nativeEvent,a=new o({active:I.current,activeNode:r,event:i,options:n,context:re,onStart(e){const t=I.current;if(null==t)return;const o=B.get(t);if(!o)return;const{onDragStart:n}=U.current,r={active:{id:t,data:o.data,rect:L}};m((()=>{null==n||n(r),D(to.Initializing),E({type:Be.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:r})}))},onMove(e){E({type:Be.DragMove,coordinates:e})},onEnd:l(Be.DragEnd),onCancel:l(Be.DragCancel)});function l(e){return async function(){const{active:t,collisions:o,over:n,scrollAdjustedTranslate:r}=re.current;let a=null;if(t&&r){const{cancelDrop:l}=U.current;if(a={activatorEvent:i,active:t,collisions:o,delta:r,over:n},e===Be.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=Be.DragCancel)}}I.current=null,m((()=>{E({type:e}),D(to.Uninitialized),Le(null),F(null),H(null);const t=e===Be.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=U.current[t];null==e||e(a),C({type:t,event:a})}}))}}m((()=>{F(a),H(e.nativeEvent)}))}),[B]),Pe=u(((e,t)=>(o,n)=>{const r=o.nativeEvent,i=B.get(n);if(null!==I.current||!i||r.dndKit||r.defaultPrevented)return;const a={active:i};!0===e(o,t.options,a)&&(r.dndKit={capturedBy:t.sensor},I.current=n,Ie(o,t))}),[B,Ie]),ze=function(e,t){return d((()=>e.reduce(((e,o)=>{const{sensor:n}=o;return[...e,...n.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,o)})))]}),[])),[e,t])}(g,Pe);!function(e){s((()=>{if(!ee)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),ce((()=>{te&&_===to.Initializing&&D(to.Initialized)}),[te,_]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:o,collisions:n,over:r}=re.current;if(!t||!o)return;const i={active:t,activatorEvent:o,collisions:n,delta:{x:Se.x,y:Se.y},over:r};m((()=>{null==e||e(i),C({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:o,droppableContainers:n,scrollAdjustedTranslate:r}=re.current;if(!e||null==I.current||!t||!r)return;const{onDragOver:i}=U.current,a=n.get(Ae),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:o,delta:{x:r.x,y:r.y},over:l};m((()=>{Le(l),null==i||i(c),C({type:"onDragOver",event:c})}))}),[Ae]),ce((()=>{re.current={activatorEvent:z,active:N,activeNode:q,collisionRect:De,collisions:Re,droppableRects:$,draggableNodes:B,draggingNode:le,draggingNodeRect:se,droppableContainers:T,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:Se},L.current={initial:se,translated:De}}),[N,q,Re,De,B,le,se,$,T,Te,me,Se]),jt({...J,delta:A,draggingRect:De,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:N,activeNode:q,activeNodeRect:te,activatorEvent:z,collisions:Re,containerNodeRect:oe,dragOverlay:ae,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Te,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:Z,windowRect:ge})),[N,q,te,z,Re,oe,ae,B,T,$,Te,X,me,be,W,Z,ge]),Ue=d((()=>({activatorEvent:z,activators:ze,active:N,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:E,draggableNodes:B,over:Te,measureDroppableContainers:X})),[z,ze,N,te,E,V,B,Te,X]);return r.createElement(_e.Provider,{value:S},r.createElement(Zt.Provider,{value:Ue},r.createElement(qt.Provider,{value:He},r.createElement(eo.Provider,{value:Ne},y)),r.createElement(Qt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),r.createElement(je,{...c,hiddenTextDescribedById:V}))})),no=i(null),ro="button",io="Droppable";function ao(e){let{id:t,data:o,disabled:n=!1,attributes:r}=e;const i=ye(io),{activators:l,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=a(Zt),{role:y=ro,roleDescription:g="draggable",tabIndex:v=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=a(m?eo:no),[w,x]=fe(),[k,O]=fe(),E=function(e,t){return d((()=>e.reduce(((e,o)=>{let{eventName:n,handler:r}=o;return e[n]=e=>{r(e,t)},e}),{})),[e,t])}(l,t),C=de(o);ce((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:C}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:y,tabIndex:v,"aria-disabled":n,"aria-pressed":!(!m||y!==ro)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[n,y,v,m,g,f.draggable]),isDragging:m,listeners:n?void 0:E,node:w,over:h,setNodeRef:x,setActivatorNodeRef:O,transform:b}}const lo="Droppable",co={timeout:25};function so(e,t,o){const n=e.slice();return n.splice(o<0?n.length+o:o,0,n.splice(t,1)[0]),n}function uo(e,t){return e.reduce(((e,o,n)=>{const r=t.get(o);return r&&(e[n]=r),e}),Array(e.length))}function fo(e){return null!==e&&e>=0}const po=e=>{let{rects:t,activeIndex:o,overIndex:n,index:r}=e;const i=so(t,n,o),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},ho={scaleX:1,scaleY:1},yo=e=>{var t;let{activeIndex:o,activeNodeRect:n,index:r,rects:i,overIndex:a}=e;const l=null!=(t=i[o])?t:n;if(!l)return null;if(r===o){const e=i[a];return e?{x:0,y:o<a?e.top+e.height-(l.top+l.height):e.top-l.top,...ho}:null}const c=function(e,t,o){const n=e[t],r=e[t-1],i=e[t+1];if(!n)return 0;if(o<t)return r?n.top-(r.top+r.height):i?i.top-(n.top+n.height):0;return i?i.top-(n.top+n.height):r?n.top-(r.top+r.height):0}(i,r,o);return r>o&&r<=a?{x:0,y:-l.height-c,...ho}:r<o&&r>=a?{x:0,y:l.height+c,...ho}:{x:0,y:0,...ho}};const go="Sortable",vo=r.createContext({activeIndex:-1,containerId:go,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:po,disabled:{draggable:!1,droppable:!1}});function mo(e){let{children:t,id:o,items:n,strategy:i=po,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:y}=a(qt),g=ye(go,o),v=Boolean(null!==f.rect),m=d((()=>n.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[n]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=l(m),O=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}(m,k.current),E=-1!==x&&-1===w||O,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);ce((()=>{O&&b&&y(m)}),[O,m,b,y]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:g,disabled:C,disableTransforms:E,items:m,overIndex:x,useDragOverlay:v,sortedRects:uo(m,p),strategy:i})),[w,g,C.draggable,C.droppable,E,m,x,p,v,i]);return r.createElement(vo.Provider,{value:S},t)}const bo=e=>{let{id:t,items:o,activeIndex:n,overIndex:r}=e;return so(o,n,r).indexOf(t)},wo=e=>{let{containerId:t,isSorting:o,wasDragging:n,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!n)&&((l===i||r!==a)&&(!!o||a!==r&&t===c))},xo={duration:200,easing:"ease"},ko="transform",Oo=xe.Transition.toString({property:ko,duration:0,easing:"linear"}),Eo={roleDescription:"sortable"};function Co(e){let{animateLayoutChanges:t=wo,attributes:o,disabled:n,data:r,getNewIndex:i=bo,id:c,strategy:p,resizeObserverConfig:h,transition:y=xo}=e;const{items:g,containerId:v,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:O,strategy:E}=a(vo),C=function(e,t){var o,n;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(o=null==e?void 0:e.draggable)?o:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(n,b),S=g.indexOf(c),_=d((()=>({sortable:{containerId:v,index:S,items:g},...r})),[v,r,S,g]),D=d((()=>g.slice(g.indexOf(c))),[g,c]),{rect:R,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:o=!1,id:n,resizeObserverConfig:r}=e;const i=ye(lo),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=a(Zt),h=l({disabled:o}),y=l(!1),g=l(null),v=l(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...co,...r},x=de(null!=b?b:n),k=Nt({callback:u((()=>{y.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),w)):y.current=!0}),[w]),disabled:m||!c}),O=u(((e,t)=>{k&&(t&&(k.unobserve(t),y.current=!1),e&&k.observe(e))}),[k]),[E,C]=fe(O),S=de(t);return s((()=>{k&&E.current&&(k.disconnect(),y.current=!1,k.observe(E.current))}),[E,k]),ce((()=>(d({type:Be.RegisterDroppable,element:{id:n,key:i,disabled:o,node:E,rect:g,data:S}}),()=>d({type:Be.UnregisterDroppable,key:i,id:n}))),[n]),s((()=>{o!==h.current.disabled&&(d({type:Be.SetDroppableDisabled,id:n,key:i,disabled:o}),h.current.disabled=o)}),[n,i,o,d]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===n,node:E,over:f,setNodeRef:C}}({id:c,data:_,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:T,activatorEvent:M,activeNodeRect:L,attributes:N,setNodeRef:I,listeners:P,isDragging:F,over:z,setActivatorNodeRef:H,transform:U}=ao({id:c,data:_,attributes:{...Eo,...o},disabled:C.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,I),K=Boolean(T),W=K&&!w&&fo(m)&&fo(k),Y=!O&&F,$=Y&&W?U:null,X=W?null!=$?$:(null!=p?p:E)({rects:x,activeNodeRect:L,activeIndex:m,overIndex:k,index:S}):null,Z=fo(m)&&fo(k)?i({id:c,items:g,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=l({activeId:q,items:g,newIndex:Z,containerId:v}),J=g!==G.current.items,Q=t({active:T,containerId:v,isDragging:F,isSorting:K,id:c,index:S,items:g,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:y,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:o,node:n,rect:r}=e;const[i,a]=f(null),c=l(o);return ce((()=>{if(!t&&o!==c.current&&n.current){const e=r.current;if(e){const t=Xe(n.current,{ignoreTransform:!0}),o={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(o.x||o.y)&&a(o)}}o!==c.current&&(c.current=o)}),[t,o,n,r]),s((()=>{i&&a(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:R});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),v!==G.current.containerId&&(G.current.containerId=v),g!==G.current.items&&(G.current.items=g)}),[K,Z,v,g]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:N,data:_,rect:R,index:S,newIndex:Z,items:g,isOver:B,isSorting:K,isDragging:F,listeners:P,node:j,overIndex:k,over:z,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:I,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return Oo;if(Y&&!be(M)||!y)return;if(K||Q)return xe.Transition.toString({...y,property:ko});return}()}}function So(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _o=[ht.Down,ht.Right,ht.Up,ht.Left],Do=(e,t)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(_o.includes(e.code)){if(e.preventDefault(),!o||!n)return;const t=[];i.getEnabled().forEach((o=>{if(!o||null!=o&&o.disabled)return;const i=r.get(o.id);if(i)switch(e.code){case ht.Down:n.top<i.top&&t.push(o);break;case ht.Up:n.top>i.top&&t.push(o);break;case ht.Left:n.left>i.left&&t.push(o);break;case ht.Right:n.left<i.left&&t.push(o)}}));const c=(e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=Pe(t),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Pe(n),a=r.reduce(((e,t,n)=>e+Le(o[n],t)),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Ne)})({active:o,collisionRect:n,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=Fe(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(o.id),t=i.get(s),a=t?r.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const o=qe(c).some(((e,t)=>l[t]!==e)),r=Ro(e,t),i=function(e,t){if(!So(e)||!So(t))return!1;if(!Ro(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=o||!r?{x:0,y:0}:{x:i?n.width-a.width:0,y:i?n.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:me(d,s)}}}};function Ro(e,t){return!(!So(e)||!So(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var jo;function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Bo.apply(this,arguments)}var Ao,To=function(e){return n.createElement("svg",Bo({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),jo||(jo=n.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Mo.apply(this,arguments)}var Lo=function(e){return n.createElement("svg",Mo({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ao||(Ao=n.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function No(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));if(r)return e.blockEditorsMap[r]}function Io(e){return zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Po(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fo(e){var t;return null==(t=(zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zo(e){return e instanceof Node||e instanceof Po(e).Node}function Ho(e){return e instanceof Element||e instanceof Po(e).Element}function Uo(e){return e instanceof HTMLElement||e instanceof Po(e).HTMLElement}function Vo(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Po(e).ShadowRoot)}function Ko(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Wo(e){return["table","td","th"].includes(Io(e))}function Yo(e){const t=$o(),o=Zo(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function $o(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xo(e){return["html","body","#document"].includes(Io(e))}function Zo(e){return Po(e).getComputedStyle(e)}function qo(e){return Ho(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Go(e){if("html"===Io(e))return e;const t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||Fo(e);return Vo(t)?t.host:t}function Jo(e){const t=Go(e);return Xo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&Ko(t)?t:Jo(t)}function Qo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Jo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Po(r);return i?t.concat(a,a.visualViewport||[],Ko(r)?r:[],a.frameElement&&o?Qo(a.frameElement):[]):t.concat(r,Qo(r,[],o))}const en=Math.min,tn=Math.max,on=Math.round,nn=Math.floor,rn=e=>({x:e,y:e}),an={left:"right",right:"left",bottom:"top",top:"bottom"},ln={start:"end",end:"start"};function cn(e,t,o){return tn(e,en(t,o))}function sn(e,t){return"function"==typeof e?e(t):e}function dn(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function fn(e){return"x"===e?"y":"x"}function pn(e){return"y"===e?"height":"width"}function hn(e){return["top","bottom"].includes(dn(e))?"y":"x"}function yn(e){return fn(hn(e))}function gn(e){return e.replace(/start|end/g,(e=>ln[e]))}function vn(e){return e.replace(/left|right|bottom|top/g,(e=>an[e]))}function mn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wn(e,t,o){let{reference:n,floating:r}=e;const i=hn(t),a=yn(t),l=pn(a),c=dn(t),s="y"===i,d=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2,f=n[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-r.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-r.width,y:u};break;default:p={x:n.x,y:n.y}}switch(un(t)){case"start":p[a]-=f*(o&&s?-1:1);break;case"end":p[a]+=f*(o&&s?-1:1)}return p}async function xn(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=sn(t,e),h=mn(p),y=l[f?"floating"===u?"reference":"floating":u],g=bn(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(y)))||o?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:c})),v="floating"===u?{...a.floating,x:n,y:r}:a.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=bn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function kn(e){const t=en(...e.map((e=>e.left))),o=en(...e.map((e=>e.top)));return{x:t,y:o,width:tn(...e.map((e=>e.right)))-t,height:tn(...e.map((e=>e.bottom)))-o}}const On=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:r,y:i,placement:a,middlewareData:l}=t,c=await async function(e,t){const{placement:o,platform:n,elements:r}=e,i=await(null==n.isRTL?void 0:n.isRTL(r.floating)),a=dn(o),l=un(o),c="y"===hn(o),s=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=sn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return a===(null==(o=l.offset)?void 0:o.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}};function En(e){const t=Zo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Uo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,l=on(o)!==i||on(n)!==a;return l&&(o=i,n=a),{width:o,height:n,$:l}}function Cn(e){return Ho(e)?e:e.contextElement}function Sn(e){const t=Cn(e);if(!Uo(t))return rn(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=En(t);let a=(i?on(o.width):o.width)/n,l=(i?on(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const _n=rn(0);function Dn(e){const t=Po(e);return $o()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_n}function Rn(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Cn(e);let a=rn(1);t&&(n?Ho(n)&&(a=Sn(n)):a=Sn(e));const l=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Po(e))&&t}(i,o,n)?Dn(i):rn(0);let c=(r.left+l.x)/a.x,s=(r.top+l.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=Po(i),t=n&&Ho(n)?Po(n):n;let o=e,r=o.frameElement;for(;r&&n&&t!==o;){const e=Sn(r),t=r.getBoundingClientRect(),n=Zo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=a,o=Po(r),r=o.frameElement}}return bn({width:d,height:u,x:c,y:s})}const jn=[":popover-open",":modal"];function Bn(e){return jn.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function An(e){return Rn(Fo(e)).left+qo(e).scrollLeft}function Tn(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=Po(e),n=Fo(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(r){i=r.width,a=r.height;const e=$o();(!e||e&&"fixed"===t)&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:l,y:c}}(e,o);else if("document"===t)n=function(e){const t=Fo(e),o=qo(e),n=e.ownerDocument.body,r=tn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=tn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+An(e);const l=-o.scrollTop;return"rtl"===Zo(n).direction&&(a+=tn(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}(Fo(e));else if(Ho(t))n=function(e,t){const o=Rn(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=Uo(e)?Sn(e):rn(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=Dn(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return bn(n)}function Mn(e,t){const o=Go(e);return!(o===t||!Ho(o)||Xo(o))&&("fixed"===Zo(o).position||Mn(o,t))}function Ln(e,t,o){const n=Uo(t),r=Fo(t),i="fixed"===o,a=Rn(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=rn(0);if(n||!n&&!i)if(("body"!==Io(t)||Ko(r))&&(l=qo(t)),n){const e=Rn(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=An(r));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Nn(e,t){return Uo(e)&&"fixed"!==Zo(e).position?t?t(e):e.offsetParent:null}function In(e,t){const o=Po(e);if(!Uo(e)||Bn(e))return o;let n=Nn(e,t);for(;n&&Wo(n)&&"static"===Zo(n).position;)n=Nn(n,t);return n&&("html"===Io(n)||"body"===Io(n)&&"static"===Zo(n).position&&!Yo(n))?o:n||function(e){let t=Go(e);for(;Uo(t)&&!Xo(t);){if(Yo(t))return t;t=Go(t)}return null}(e)||o}const Pn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Fo(n),l=!!t&&Bn(t.floating);if(n===a||l&&i)return o;let c={scrollLeft:0,scrollTop:0},s=rn(1);const d=rn(0),u=Uo(n);if((u||!u&&!i)&&(("body"!==Io(n)||Ko(a))&&(c=qo(n)),Uo(n))){const e=Rn(n);s=Sn(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-c.scrollLeft*s.x+d.x,y:o.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Fo,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=Qo(e,[],!1).filter((e=>Ho(e)&&"body"!==Io(e))),r=null;const i="fixed"===Zo(e).position;let a=i?Go(e):e;for(;Ho(a)&&!Xo(a);){const t=Zo(a),o=Yo(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Ko(a)&&!o&&Mn(e,a))?n=n.filter((e=>e!==a)):r=t,a=Go(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],l=i.reduce(((e,o)=>{const n=Tn(t,o,r);return e.top=tn(n.top,e.top),e.right=en(n.right,e.right),e.bottom=en(n.bottom,e.bottom),e.left=tn(n.left,e.left),e}),Tn(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:In,getElementRects:async function(e){const t=this.getOffsetParent||In,o=this.getDimensions;return{reference:Ln(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=En(e);return{width:t,height:o}},getScale:Sn,isElement:Ho,isRTL:function(e){return"rtl"===Zo(e).direction}};function Fn(e,t,o,n){void 0===n&&(n={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,s=Cn(e),d=r||i?[...s?Qo(s):[],...Qo(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",o,{passive:!0}),i&&e.addEventListener("resize",o)}));const u=s&&l?function(e,t){let o,n=null;const r=Fo(e);function i(){var e;clearTimeout(o),null==(e=n)||e.disconnect(),n=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const p={rootMargin:-nn(d)+"px "+-nn(r.clientWidth-(s+u))+"px "+-nn(r.clientHeight-(d+f))+"px "+-nn(s)+"px",threshold:tn(0,en(1,c))||1};let h=!0;function y(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return a();t?a(!1,t):o=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(y,{...p,root:r.ownerDocument})}catch(e){n=new IntersectionObserver(y,p)}n.observe(e)}(!0),i}(s,o):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),o()})),s&&!c&&h.observe(s),h.observe(t));let y=c?Rn(e):null;return c&&function t(){const n=Rn(e);!y||n.x===y.x&&n.y===y.y&&n.width===y.width&&n.height===y.height||o();y=n,f=requestAnimationFrame(t)}(),o(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",o),i&&e.removeEventListener("resize",o)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(f)}}const zn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...c}=sn(e,t),s={x:o,y:n},d=await xn(t,c),u=hn(dn(r)),f=fn(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=cn(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=cn(h+d["y"===u?"top":"left"],h,h-d[e])}const y=l.fn({...t,[f]:p,[u]:h});return{...y,data:{x:y.x-o,y:y.y-n}}}}},Hn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=sn(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const v=dn(r),m=dn(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!y?[vn(l)]:function(e){const t=vn(e);return[gn(e),t,gn(t)]}(l));f||"none"===h||w.push(...function(e,t,o,n){const r=un(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(dn(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(gn)))),i}(l,y,h,b));const x=[l,...w],k=await xn(t,g),O=[];let E=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&O.push(k[v]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=un(e),r=yn(e),i=pn(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=vn(a)),[a,vn(a)]}(r,a,b);O.push(k[e[0]],k[e[1]])}if(E=[...E,{placement:r,overflows:O}],!O.every((e=>e<=0))){var C,S;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let o=null==(S=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=l}if(r!==o)return{reset:{placement:o}}}return{}}}},Un=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:r,platform:i,strategy:a}=t,{padding:l=2,x:c,y:s}=sn(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let n=null;for(let e=0;e<t.length;e++){const r=t[e];!n||r.y-n.y>n.height/2?o.push([r]):o[o.length-1].push(r),n=r}return o.map((e=>bn(kn(e))))}(d),f=bn(kn(d)),p=mn(l);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===hn(o)){const e=u[0],t=u[u.length-1],n="top"===dn(o),r=e.top,i=t.bottom,a=n?e.left:t.left,l=n?e.right:t.right;return{top:r,bottom:i,left:a,right:l,width:l-a,height:i-r,x:a,y:r}}const e="left"===dn(o),t=tn(...u.map((e=>e.right))),n=en(...u.map((e=>e.left))),r=u.filter((o=>e?o.left===n:o.right===t)),i=r[0].top,a=r[r.length-1].bottom;return{top:i,bottom:a,left:n,right:t,width:t-n,height:a-i,x:n,y:i}}return f}},floating:n.floating,strategy:a});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Vn=(e,t,o)=>{const n=new Map,r={platform:Pn,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,l=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let s=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=wn(s,n,c),f=n,p={},h=0;for(let o=0;o<l.length;o++){const{name:i,fn:y}=l[o],{x:g,y:v,data:m,reset:b}=await y({x:d,y:u,initialPlacement:n,placement:f,strategy:r,middlewareData:p,rects:s,platform:a,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=wn(s,f,c))),o=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Kn="undefined"!=typeof document?c:s;function Wn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,n,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;0!=n--;)if(!Wn(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;0!=n--;){const o=r[n];if(("_owner"!==o||!e.$$typeof)&&!Wn(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Yn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $n(e,t){const o=Yn(e);return Math.round(t*o)/o}function Xn(e){const t=n.useRef(e);return Kn((()=>{t.current=e})),t}
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import*as n from"react";import r,{createContext as i,useContext as a,useRef as l,useLayoutEffect as c,useEffect as s,useMemo as d,useCallback as u,useState as f,memo as p,useReducer as h,forwardRef as y,createElement as g}from"react";import*as v from"react-dom";import{unstable_batchedUpdates as m,createPortal as b}from"react-dom";import{ReactEditor as w,useSelected as x,Slate as k,Editable as E,DefaultElement as O,withReact as C}from"slate-react";import{Editor as S,Transforms as _,Path as D,Range as R,Text as j,Element as B,Operation as A,createEditor as T,Point as M}from"slate";class L{constructor(e){this.plugin=e}get getPlugin(){return this.plugin}extend(e){const{renders:t,options:o}=e,n=Object.assign(Object.assign({},this.plugin.options),o),r=Object.assign({},this.plugin.elements);return t&&Object.keys(t).forEach((e=>{const o=r[e];o&&o.render&&(r[e].render=o=>t[e](o))})),new L(Object.assign(Object.assign({},this.plugin),{elements:r,options:n}))}}function N(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));return r?e.children[r]:null}const I={editor:{getBlock:()=>{},insertBlock:()=>{},insertBlocks:()=>{},updateBlock:()=>{},moveBlock:()=>{},splitBlock:()=>{},deleteBlock:()=>{},toggleBlock:()=>{},focusBlock:()=>{},setSelection:()=>{},applyChanges:()=>{},decreaseBlockDepth:()=>{},increaseBlockDepth:()=>{},setBlockSelected:()=>{},selectedBlocks:[],duplicateBlock:()=>{},getEditorValue:()=>{},blur:()=>{},blocks:{},shortcuts:{},plugins:{},formats:{},selection:null,readOnly:!1,blockEditorsMap:{},children:{},emit:()=>{},on:()=>{},off:()=>{},once:()=>{}}},P=i(I),F=({children:t,editorState:o})=>{const n=l(I);return n.current={editor:o.editor},e(P.Provider,Object.assign({value:n.current},{children:t}))},z=()=>{const e=a(P);if(!e)throw new Error("useYooptaEditor must be used within a YooptaEditorContext");return e.editor},H=e=>z().children[e],U=e=>z().blocks[e],V=e=>z().plugins[e],K=()=>z().readOnly,W=e=>{var t;return null===(t=V(e))||void 0===t?void 0:t.options},Y=({blockId:e,path:t})=>{var o;const n=z();if(!e&&!t)throw new Error("useBlockSelected must receive either blockId or path");let r;return e&&(r=n.children[e]),t&&(r=N(n,{at:t})),(null===(o=n.selection)||void 0===o?void 0:o[0])===(null==r?void 0:r.meta.order)};var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},X={};!function(e){var t=Object.prototype.hasOwnProperty,o="~";function n(){}function r(e,t,o){this.fn=e,this.context=t,this.once=o||!1}function i(e,t,n,i,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var l=new r(n,i||e,a),c=o?o+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],l]:e._events[c].push(l):(e._events[c]=l,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function l(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(o=!1)),l.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(o?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},l.prototype.listeners=function(e){var t=o?o+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,a=new Array(i);r<i;r++)a[r]=n[r].fn;return a},l.prototype.listenerCount=function(e){var t=o?o+e:e,n=this._events[t];return n?n.fn?1:n.length:0},l.prototype.emit=function(e,t,n,r,i,a){var l=o?o+e:e;if(!this._events[l])return!1;var c,s,d=this._events[l],u=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),u){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,n),!0;case 4:return d.fn.call(d.context,t,n,r),!0;case 5:return d.fn.call(d.context,t,n,r,i),!0;case 6:return d.fn.call(d.context,t,n,r,i,a),!0}for(s=1,c=new Array(u-1);s<u;s++)c[s-1]=arguments[s];d.fn.apply(d.context,c)}else{var f,p=d.length;for(s=0;s<p;s++)switch(d[s].once&&this.removeListener(e,d[s].fn,void 0,!0),u){case 1:d[s].fn.call(d[s].context);break;case 2:d[s].fn.call(d[s].context,t);break;case 3:d[s].fn.call(d[s].context,t,n);break;case 4:d[s].fn.call(d[s].context,t,n,r);break;default:if(!c)for(f=1,c=new Array(u-1);f<u;f++)c[f-1]=arguments[f];d[s].fn.apply(d[s].context,c)}}return!0},l.prototype.on=function(e,t,o){return i(this,e,t,o,!1)},l.prototype.once=function(e,t,o){return i(this,e,t,o,!0)},l.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var l=this._events[i];if(l.fn)l.fn!==t||r&&!l.once||n&&l.context!==n||a(this,i);else{for(var c=0,s=[],d=l.length;c<d;c++)(l[c].fn!==t||r&&!l[c].once||n&&l[c].context!==n)&&s.push(l[c]);s.length?this._events[i]=1===s.length?s[0]:s:a(this,i)}return this},l.prototype.removeAllListeners=function(e){var t;return e?(t=o?o+e:e,this._events[t]&&a(this,t)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=o,l.EventEmitter=l,e.exports=l}({get exports(){return X},set exports(e){X=e}});var Z=X;function q(){let e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}const G=()=>{var e,t;return"undefined"==typeof window||"function"!=typeof(null===(e=window.crypto)||void 0===e?void 0:e.randomUUID)?q():null===(t=window.crypto)||void 0===t?void 0:t.randomUUID()},J=e=>({id:G(),type:(null==e?void 0:e.type)||"paragraph",children:(null==e?void 0:e.children)||[{text:""}],props:Object.assign({nodeType:"block"},null==e?void 0:e.props)}),Q=e=>({id:(null==e?void 0:e.id)||G(),value:(null==e?void 0:e.value)||[J()],type:(null==e?void 0:e.type)||"Paragraph",meta:Object.assign({order:0,depth:0},null==e?void 0:e.meta)});const ee="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function te(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function oe(e){return"nodeType"in e}function ne(e){var t,o;return e?te(e)?e:oe(e)&&null!=(t=null==(o=e.ownerDocument)?void 0:o.defaultView)?t:window:window}function re(e){const{Document:t}=ne(e);return e instanceof t}function ie(e){return!te(e)&&e instanceof ne(e).HTMLElement}function ae(e){return e instanceof ne(e).SVGElement}function le(e){return e?te(e)?e.document:oe(e)?re(e)?e:ie(e)||ae(e)?e.ownerDocument:document:document:document}const ce=ee?c:s;function se(e){const t=l(e);return ce((()=>{t.current=e})),u((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}function de(e,t){void 0===t&&(t=[e]);const o=l(e);return ce((()=>{o.current!==e&&(o.current=e)}),t),o}function ue(e,t){const o=l();return d((()=>{const t=e(o.current);return o.current=t,t}),[...t])}function fe(e){const t=se(e),o=l(null),n=u((e=>{e!==o.current&&(null==t||t(e,o.current)),o.current=e}),[]);return[o,n]}function pe(e){const t=l();return s((()=>{t.current=e}),[e]),t.current}let he={};function ye(e,t){return d((()=>{if(t)return t;const o=null==he[e]?0:he[e]+1;return he[e]=o,e+"-"+o}),[e,t])}function ge(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>{const n=Object.entries(o);for(const[o,r]of n){const n=t[o];null!=n&&(t[o]=n+e*r)}return t}),{...t})}}const ve=ge(1),me=ge(-1);function be(e){if(!e)return!1;const{KeyboardEvent:t}=ne(e.target);return t&&e instanceof t}function we(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=ne(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:o}=e.touches[0];return{x:t,y:o}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:o}=e.changedTouches[0];return{x:t,y:o}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const xe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:o}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:o}=e;return"scaleX("+t+") scaleY("+o+")"}},Transform:{toString(e){if(e)return[xe.Translate.toString(e),xe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:o,easing:n}=e;return t+" "+o+"ms "+n}}}),ke="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ee(e){return e.matches(ke)?e:e.querySelector(ke)}const Oe={display:"none"};function Ce(e){let{id:t,value:o}=e;return r.createElement("div",{id:t,style:Oe},o)}function Se(e){let{id:t,announcement:o,ariaLiveType:n="assertive"}=e;return r.createElement("div",{id:t,style:{position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},o)}const _e=i(null);const De={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Re={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was moved over droppable area "+o.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:o}=e;return o?"Draggable item "+t.id+" was dropped over droppable area "+o.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function je(e){let{announcements:t=Re,container:o,hiddenTextDescribedById:n,screenReaderInstructions:i=De}=e;const{announce:l,announcement:c}=function(){const[e,t]=f("");return{announce:u((e=>{null!=e&&t(e)}),[]),announcement:e}}(),p=ye("DndLiveRegion"),[h,y]=f(!1);if(s((()=>{y(!0)}),[]),function(e){const t=a(_e);s((()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)}),[e,t])}(d((()=>({onDragStart(e){let{active:o}=e;l(t.onDragStart({active:o}))},onDragMove(e){let{active:o,over:n}=e;t.onDragMove&&l(t.onDragMove({active:o,over:n}))},onDragOver(e){let{active:o,over:n}=e;l(t.onDragOver({active:o,over:n}))},onDragEnd(e){let{active:o,over:n}=e;l(t.onDragEnd({active:o,over:n}))},onDragCancel(e){let{active:o,over:n}=e;l(t.onDragCancel({active:o,over:n}))}})),[l,t])),!h)return null;const g=r.createElement(r.Fragment,null,r.createElement(Ce,{id:n,value:i.draggable}),r.createElement(Se,{id:p,announcement:c}));return o?b(g,o):g}var Be;function Ae(){}function Te(e,t){return d((()=>({sensor:e,options:null!=t?t:{}})),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Be||(Be={}));const Me=Object.freeze({x:0,y:0});function Le(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ne(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return o-n}function Ie(e,t){let{data:{value:o}}=e,{data:{value:n}}=t;return n-o}function Pe(e){let{left:t,top:o,height:n,width:r}=e;return[{x:t,y:o},{x:t+r,y:o},{x:t,y:o+n},{x:t+r,y:o+n}]}function Fe(e,t){if(!e||0===e.length)return null;const[o]=e;return t?o[t]:o}function ze(e,t,o){return void 0===t&&(t=e.left),void 0===o&&(o=e.top),{x:t+.5*e.width,y:o+.5*e.height}}const He=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=ze(t,t.left,t.top),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Le(ze(n),r);i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(Ne)};function Ue(e,t){const o=Math.max(t.top,e.top),n=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-n,l=i-o;if(n<r&&o<i){const o=t.width*t.height,n=e.width*e.height,r=a*l;return Number((r/(o+n-r)).toFixed(4))}return 0}const Ve=e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=[];for(const e of n){const{id:n}=e,i=o.get(n);if(i){const o=Ue(i,t);o>0&&r.push({id:n,data:{droppableContainer:e,value:o}})}}return r.sort(Ie)};function Ke(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Me}function We(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce(((t,o)=>({...t,top:t.top+e*o.y,bottom:t.bottom+e*o.y,left:t.left+e*o.x,right:t.right+e*o.x})),{...t})}}const Ye=We(1);const $e={ignoreTransform:!1};function Xe(e,t){void 0===t&&(t=$e);let o=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:n}=ne(e).getComputedStyle(e);t&&(o=function(e,t,o){const n=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!n)return e;const{scaleX:r,scaleY:i,x:a,y:l}=n,c=e.left-a-(1-r)*parseFloat(o),s=e.top-l-(1-i)*parseFloat(o.slice(o.indexOf(" ")+1)),d=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:s,right:c+d,bottom:s+u,left:c}}(o,t,n))}const{top:n,left:r,width:i,height:a,bottom:l,right:c}=o;return{top:n,left:r,width:i,height:a,bottom:l,right:c}}function Ze(e){return Xe(e,{ignoreTransform:!0})}function qe(e,t){const o=[];return e?function n(r){if(null!=t&&o.length>=t)return o;if(!r)return o;if(re(r)&&null!=r.scrollingElement&&!o.includes(r.scrollingElement))return o.push(r.scrollingElement),o;if(!ie(r)||ae(r))return o;if(o.includes(r))return o;const i=ne(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=ne(e).getComputedStyle(e));const o=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const n=t[e];return"string"==typeof n&&o.test(n)}))}(r,i)&&o.push(r),function(e,t){return void 0===t&&(t=ne(e).getComputedStyle(e)),"fixed"===t.position}(r,i)?o:n(r.parentNode)}(e):o}function Ge(e){const[t]=qe(e,1);return null!=t?t:null}function Je(e){return ee&&e?te(e)?e:oe(e)?re(e)||e===le(e).scrollingElement?window:ie(e)?e:null:null:null}function Qe(e){return te(e)?e.scrollX:e.scrollLeft}function et(e){return te(e)?e.scrollY:e.scrollTop}function tt(e){return{x:Qe(e),y:et(e)}}var ot;function nt(e){return!(!ee||!e)&&e===document.scrollingElement}function rt(e){const t={x:0,y:0},o=nt(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-o.width,y:e.scrollHeight-o.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(ot||(ot={}));const it={x:.2,y:.2};function at(e,t,o,n,r){let{top:i,left:a,right:l,bottom:c}=o;void 0===n&&(n=10),void 0===r&&(r=it);const{isTop:s,isBottom:d,isLeft:u,isRight:f}=rt(e),p={x:0,y:0},h={x:0,y:0},y=t.height*r.y,g=t.width*r.x;return!s&&i<=t.top+y?(p.y=ot.Backward,h.y=n*Math.abs((t.top+y-i)/y)):!d&&c>=t.bottom-y&&(p.y=ot.Forward,h.y=n*Math.abs((t.bottom-y-c)/y)),!f&&l>=t.right-g?(p.x=ot.Forward,h.x=n*Math.abs((t.right-g-l)/g)):!u&&a<=t.left+g&&(p.x=ot.Backward,h.x=n*Math.abs((t.left+g-a)/g)),{direction:p,speed:h}}function lt(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:o,right:n,bottom:r}=e.getBoundingClientRect();return{top:t,left:o,right:n,bottom:r,width:e.clientWidth,height:e.clientHeight}}function ct(e){return e.reduce(((e,t)=>ve(e,tt(t))),Me)}const st=[["x",["left","right"],function(e){return e.reduce(((e,t)=>e+Qe(t)),0)}],["y",["top","bottom"],function(e){return e.reduce(((e,t)=>e+et(t)),0)}]];class dt{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=qe(t),n=ct(o);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of st)for(const i of t)Object.defineProperty(this,i,{get:()=>{const t=r(o),a=n[e]-t;return this.rect[i]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ut{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach((e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)}))},this.target=e}add(e,t,o){var n;null==(n=this.target)||n.addEventListener(e,t,o),this.listeners.push([e,t,o])}}function ft(e,t){const o=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(o**2+n**2)>t:"x"in t&&"y"in t?o>t.x&&n>t.y:"x"in t?o>t.x:"y"in t&&n>t.y}var pt,ht;function yt(e){e.preventDefault()}function gt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(pt||(pt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"}(ht||(ht={}));const vt={start:[ht.Space,ht.Enter],cancel:[ht.Esc],end:[ht.Space,ht.Enter]},mt=(e,t)=>{let{currentCoordinates:o}=t;switch(e.code){case ht.Right:return{...o,x:o.x+25};case ht.Left:return{...o,x:o.x-25};case ht.Down:return{...o,y:o.y+25};case ht.Up:return{...o,y:o.y-25}}};class bt{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ut(le(t)),this.windowListeners=new ut(ne(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout((()=>this.listeners.add(pt.Keydown,this.handleKeyDown)))}handleStart(){const{activeNode:e,onStart:t}=this.props,o=e.node.current;o&&function(e,t){if(void 0===t&&(t=Xe),!e)return;const{top:o,left:n,bottom:r,right:i}=t(e);Ge(e)&&(r<=0||i<=0||o>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(o),t(Me)}handleKeyDown(e){if(be(e)){const{active:t,context:o,options:n}=this.props,{keyboardCodes:r=vt,coordinateGetter:i=mt,scrollBehavior:a="smooth"}=n,{code:l}=e;if(r.end.includes(l))return void this.handleEnd(e);if(r.cancel.includes(l))return void this.handleCancel(e);const{collisionRect:c}=o.current,s=c?{x:c.left,y:c.top}:Me;this.referenceCoordinates||(this.referenceCoordinates=s);const d=i(e,{active:t,context:o.current,currentCoordinates:s});if(d){const t=me(d,s),n={x:0,y:0},{scrollableAncestors:r}=o.current;for(const o of r){const r=e.code,{isTop:i,isRight:l,isLeft:c,isBottom:s,maxScroll:u,minScroll:f}=rt(o),p=lt(o),h={x:Math.min(r===ht.Right?p.right-p.width/2:p.right,Math.max(r===ht.Right?p.left:p.left+p.width/2,d.x)),y:Math.min(r===ht.Down?p.bottom-p.height/2:p.bottom,Math.max(r===ht.Down?p.top:p.top+p.height/2,d.y))},y=r===ht.Right&&!l||r===ht.Left&&!c,g=r===ht.Down&&!s||r===ht.Up&&!i;if(y&&h.x!==d.x){const e=o.scrollLeft+t.x,i=r===ht.Right&&e<=u.x||r===ht.Left&&e>=f.x;if(i&&!t.y)return void o.scrollTo({left:e,behavior:a});n.x=i?o.scrollLeft-e:r===ht.Right?o.scrollLeft-u.x:o.scrollLeft-f.x,n.x&&o.scrollBy({left:-n.x,behavior:a});break}if(g&&h.y!==d.y){const e=o.scrollTop+t.y,i=r===ht.Down&&e<=u.y||r===ht.Up&&e>=f.y;if(i&&!t.x)return void o.scrollTo({top:e,behavior:a});n.y=i?o.scrollTop-e:r===ht.Down?o.scrollTop-u.y:o.scrollTop-f.y,n.y&&o.scrollBy({top:-n.y,behavior:a});break}}this.handleMove(e,ve(me(d,this.referenceCoordinates),n))}}}handleMove(e,t){const{onMove:o}=this.props;e.preventDefault(),o(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function wt(e){return Boolean(e&&"distance"in e)}function xt(e){return Boolean(e&&"delay"in e)}bt.activators=[{eventName:"onKeyDown",handler:(e,t,o)=>{let{keyboardCodes:n=vt,onActivation:r}=t,{active:i}=o;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class kt{constructor(e,t,o){var n;void 0===o&&(o=function(e){const{EventTarget:t}=ne(e);return e instanceof t?e:le(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=le(i),this.documentListeners=new ut(this.document),this.listeners=new ut(o),this.windowListeners=new ut(ne(i)),this.initialCoordinates=null!=(n=we(r))?n:Me,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:o}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,yt),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,yt),this.documentListeners.add(pt.Keydown,this.handleKeydown),t){if(null!=o&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xt(t))return void(this.timeoutId=setTimeout(this.handleStart,t.delay));if(wt(t))return}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(pt.Click,gt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:o,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;const l=null!=(t=we(e))?t:Me,c=me(n,l);if(!o&&a){if(wt(a)){if(null!=a.tolerance&&ft(c,a.tolerance))return this.handleCancel();if(ft(c,a.distance))return this.handleStart()}return xt(a)&&ft(c,a.tolerance)?this.handleCancel():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===ht.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const Et={move:{name:"pointermove"},end:{name:"pointerup"}};class Ot extends kt{constructor(e){const{event:t}=e,o=le(t.target);super(e,Et,o)}}Ot.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return!(!o.isPrimary||0!==o.button)&&(null==n||n({event:o}),!0)}}];const Ct={move:{name:"mousemove"},end:{name:"mouseup"}};var St;!function(e){e[e.RightClick=2]="RightClick"}(St||(St={}));(class extends kt{constructor(e){super(e,Ct,le(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;return o.button!==St.RightClick&&(null==n||n({event:o}),!0)}}];const _t={move:{name:"touchmove"},end:{name:"touchend"}};var Dt,Rt;function jt(e){let{acceleration:t,activator:o=Dt.Pointer,canScroll:n,draggingRect:r,enabled:i,interval:a=5,order:c=Rt.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:h,delta:y,threshold:g}=e;const v=function(e){let{delta:t,disabled:o}=e;const n=pe(t);return ue((e=>{if(o||!n||!e)return Bt;const r={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ot.Backward]:e.x[ot.Backward]||-1===r.x,[ot.Forward]:e.x[ot.Forward]||1===r.x},y:{[ot.Backward]:e.y[ot.Backward]||-1===r.y,[ot.Forward]:e.y[ot.Forward]||1===r.y}}}),[o,t,n])}({delta:y,disabled:!i}),[m,b]=function(){const e=l(null);return[u(((t,o)=>{e.current=setInterval(t,o)}),[]),u((()=>{null!==e.current&&(clearInterval(e.current),e.current=null)}),[])]}(),w=l({x:0,y:0}),x=l({x:0,y:0}),k=d((()=>{switch(o){case Dt.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Dt.DraggableRect:return r}}),[o,r,f]),E=l(null),O=u((()=>{const e=E.current;if(!e)return;const t=w.current.x*x.current.x,o=w.current.y*x.current.y;e.scrollBy(t,o)}),[]),C=d((()=>c===Rt.TreeOrder?[...p].reverse():p),[c,p]);s((()=>{if(i&&p.length&&k){for(const e of C){if(!1===(null==n?void 0:n(e)))continue;const o=p.indexOf(e),r=h[o];if(!r)continue;const{direction:i,speed:l}=at(e,r,k,t,g);for(const e of["x","y"])v[e][i[e]]||(l[e]=0,i[e]=0);if(l.x>0||l.y>0)return b(),E.current=e,m(O,a),w.current=l,void(x.current=i)}w.current={x:0,y:0},x.current={x:0,y:0},b()}else b()}),[t,O,n,b,i,a,JSON.stringify(k),JSON.stringify(v),m,p,C,h,JSON.stringify(g)])}(class extends kt{constructor(e){super(e,_t)}static setup(){return window.addEventListener(_t.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(_t.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:o}=e,{onActivation:n}=t;const{touches:r}=o;return!(r.length>1)&&(null==n||n({event:o}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(Dt||(Dt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(Rt||(Rt={}));const Bt={x:{[ot.Backward]:!1,[ot.Forward]:!1},y:{[ot.Backward]:!1,[ot.Forward]:!1}};var At,Tt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(At||(At={})),function(e){e.Optimized="optimized"}(Tt||(Tt={}));const Mt=new Map;function Lt(e,t){return ue((o=>e?o||("function"==typeof t?t(e):e):null),[t,e])}function Nt(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(n)}),[o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}function It(e){return new dt(Xe(e),e)}function Pt(e,t,o){void 0===t&&(t=It);const[n,r]=h((function(n){if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=n?n:o)?r:null;const i=t(e);if(JSON.stringify(n)===JSON.stringify(i))return n;return i}),null),i=function(e){let{callback:t,disabled:o}=e;const n=se(t),r=d((()=>{if(o||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(n)}),[n,o]);return s((()=>()=>null==r?void 0:r.disconnect()),[r]),r}({callback(t){if(e)for(const o of t){const{type:t,target:n}=o;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){r();break}}}}),a=Nt({callback:r});return ce((()=>{r(),e?(null==a||a.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==a||a.disconnect(),null==i||i.disconnect())}),[e]),n}const Ft=[];function zt(e,t){void 0===t&&(t=[]);const o=l(null);return s((()=>{o.current=null}),t),s((()=>{const t=e!==Me;t&&!o.current&&(o.current=e),!t&&o.current&&(o.current=null)}),[e]),o.current?me(e,o.current):Me}function Ht(e){return d((()=>e?function(e){const t=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:t,bottom:o,width:t,height:o}}(e):null),[e])}const Ut=[];function Vt(e){let{measure:t}=e;const[o,n]=f(null),r=u((e=>{for(const{target:o}of e)if(ie(o)){n((e=>{const n=t(o);return e?{...e,width:n.width,height:n.height}:n}));break}}),[t]),i=Nt({callback:r}),a=u((e=>{const o=function(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ie(t)?t:e}(e);null==i||i.disconnect(),o&&(null==i||i.observe(o)),n(o?t(o):null)}),[t,i]),[l,c]=fe(a);return d((()=>({nodeRef:l,rect:o,setRef:c})),[o,l,c])}const Kt=[{sensor:Ot,options:{}},{sensor:bt,options:{}}],Wt={current:{}},Yt={draggable:{measure:Ze},droppable:{measure:Ze,strategy:At.WhileDragging,frequency:Tt.Optimized},dragOverlay:{measure:Xe}};class $t extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter((e=>{let{disabled:t}=e;return!t}))}getNodeFor(e){var t,o;return null!=(t=null==(o=this.get(e))?void 0:o.node.current)?t:void 0}}const Xt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new $t,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ae},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Yt,measureDroppableContainers:Ae,windowRect:null,measuringScheduled:!1},Zt=i({activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ae,draggableNodes:new Map,over:null,measureDroppableContainers:Ae}),qt=i(Xt);function Gt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new $t}}}function Jt(e,t){switch(t.type){case Be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Be.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Be.DragEnd:case Be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Be.RegisterDroppable:{const{element:o}=t,{id:n}=o,r=new $t(e.droppable.containers);return r.set(n,o),{...e,droppable:{...e.droppable,containers:r}}}case Be.SetDroppableDisabled:{const{id:o,key:n,disabled:r}=t,i=e.droppable.containers.get(o);if(!i||n!==i.key)return e;const a=new $t(e.droppable.containers);return a.set(o,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case Be.UnregisterDroppable:{const{id:o,key:n}=t,r=e.droppable.containers.get(o);if(!r||n!==r.key)return e;const i=new $t(e.droppable.containers);return i.delete(o),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Qt(e){let{disabled:t}=e;const{active:o,activatorEvent:n,draggableNodes:r}=a(Zt),i=pe(n),l=pe(null==o?void 0:o.id);return s((()=>{if(!t&&!n&&i&&null!=l){if(!be(i))return;if(document.activeElement===i.target)return;const e=r.get(l);if(!e)return;const{activatorNode:t,node:o}=e;if(!t.current&&!o.current)return;requestAnimationFrame((()=>{for(const e of[t.current,o.current]){if(!e)continue;const t=Ee(e);if(t){t.focus();break}}}))}}),[n,t,r,l,i]),null}const eo=i({...Me,scaleX:1,scaleY:1});var to;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(to||(to={}));const oo=p((function(e){var t,o,n,i;let{id:a,accessibility:c,autoScroll:p=!0,children:y,sensors:g=Kt,collisionDetection:v=Ve,measuring:b,modifiers:w,...x}=e;const k=h(Jt,void 0,Gt),[E,O]=k,[C,S]=function(){const[e]=f((()=>new Set)),t=u((t=>(e.add(t),()=>e.delete(t))),[e]);return[u((t=>{let{type:o,event:n}=t;e.forEach((e=>{var t;return null==(t=e[o])?void 0:t.call(e,n)}))}),[e]),t]}(),[_,D]=f(to.Uninitialized),R=_===to.Initialized,{draggable:{active:j,nodes:B,translate:A},droppable:{containers:T}}=E,M=j?B.get(j):null,L=l({initial:null,translated:null}),N=d((()=>{var e;return null!=j?{id:j,data:null!=(e=null==M?void 0:M.data)?e:Wt,rect:L}:null}),[j,M]),I=l(null),[P,F]=f(null),[z,H]=f(null),U=de(x,Object.values(x)),V=ye("DndDescribedBy",a),K=d((()=>T.getEnabled()),[T]),W=d((()=>({draggable:{...Yt.draggable,...null==Y?void 0:Y.draggable},droppable:{...Yt.droppable,...null==Y?void 0:Y.droppable},dragOverlay:{...Yt.dragOverlay,...null==Y?void 0:Y.dragOverlay}})),[null==(Y=b)?void 0:Y.draggable,null==Y?void 0:Y.droppable,null==Y?void 0:Y.dragOverlay]);var Y;const{droppableRects:$,measureDroppableContainers:X,measuringScheduled:Z}=function(e,t){let{dragging:o,dependencies:n,config:r}=t;const[i,a]=f(null),{frequency:c,measure:d,strategy:p}=r,h=l(e),y=function(){switch(p){case At.Always:return!1;case At.BeforeDragging:return o;default:return!o}}(),g=de(y),v=u((function(e){void 0===e&&(e=[]),g.current||a((t=>null===t?e:t.concat(e.filter((e=>!t.includes(e))))))}),[g]),m=l(null),b=ue((t=>{if(y&&!o)return Mt;if(!t||t===Mt||h.current!==e||null!=i){const t=new Map;for(let o of e){if(!o)continue;if(i&&i.length>0&&!i.includes(o.id)&&o.rect.current){t.set(o.id,o.rect.current);continue}const e=o.node.current,n=e?new dt(d(e),e):null;o.rect.current=n,n&&t.set(o.id,n)}return t}return t}),[e,i,o,y,d]);return s((()=>{h.current=e}),[e]),s((()=>{y||v()}),[o,y]),s((()=>{i&&i.length>0&&a(null)}),[JSON.stringify(i)]),s((()=>{y||"number"!=typeof c||null!==m.current||(m.current=setTimeout((()=>{v(),m.current=null}),c))}),[c,y,v,...n]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:null!=i}}(K,{dragging:R,dependencies:[A.x,A.y],config:W.droppable}),q=function(e,t){const o=null!==t?e.get(t):void 0,n=o?o.node.current:null;return ue((e=>{var o;return null===t?null:null!=(o=null!=n?n:e)?o:null}),[n,t])}(B,j),G=d((()=>z?we(z):null),[z]),J=function(){const e=!1===(null==P?void 0:P.autoScrollEnabled),t="object"==typeof p?!1===p.enabled:!1===p,o=R&&!e&&!t;if("object"==typeof p)return{...p,enabled:o};return{enabled:o}}(),Q=function(e,t){return Lt(e,t)}(q,W.draggable.measure);!function(e){let{activeNode:t,measure:o,initialRect:n,config:r=!0}=e;const i=l(!1),{x:a,y:c}="boolean"==typeof r?{x:r,y:r}:r;ce((()=>{if(!a&&!c||!t)return void(i.current=!1);if(i.current||!n)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const r=Ke(o(e),n);if(a||(r.x=0),c||(r.y=0),i.current=!0,Math.abs(r.x)>0||Math.abs(r.y)>0){const t=Ge(e);t&&t.scrollBy({top:r.y,left:r.x})}}),[t,a,c,n,o])}({activeNode:j?B.get(j):null,config:J.layoutShiftCompensation,initialRect:Q,measure:W.draggable.measure});const te=Pt(q,W.draggable.measure,Q),oe=Pt(q?q.parentElement:null),re=l({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:$,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=T.getNodeFor(null==(t=re.current.over)?void 0:t.id),ae=Vt({measure:W.dragOverlay.measure}),le=null!=(o=ae.nodeRef.current)?o:q,se=R?null!=(n=ae.rect)?n:te:null,fe=Boolean(ae.nodeRef.current&&ae.rect),pe=Ke(he=fe?null:te,Lt(he));var he;const ge=Ht(le?ne(le):null),me=function(e){const t=l(e),o=ue((o=>e?o&&o!==Ft&&e&&t.current&&e.parentNode===t.current.parentNode?o:qe(e):Ft),[e]);return s((()=>{t.current=e}),[e]),o}(R?null!=ie?ie:q:null),be=function(e,t){void 0===t&&(t=Xe);const[o]=e,n=Ht(o?ne(o):null),[r,i]=h((function(){return e.length?e.map((e=>nt(e)?n:new dt(t(e),e))):Ut}),Ut),a=Nt({callback:i});return e.length>0&&r===Ut&&i(),ce((()=>{e.length?e.forEach((e=>null==a?void 0:a.observe(e))):(null==a||a.disconnect(),i())}),[e]),r}(me),xe=function(e,t){let{transform:o,...n}=t;return null!=e&&e.length?e.reduce(((e,t)=>t({transform:e,...n})),o):o}(w,{transform:{x:A.x-pe.x,y:A.y-pe.y,scaleX:1,scaleY:1},activatorEvent:z,active:N,activeNodeRect:te,containerNodeRect:oe,draggingNodeRect:se,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:me,scrollableAncestorRects:be,windowRect:ge}),ke=G?ve(G,A):null,Ee=function(e){const[t,o]=f(null),n=l(e),r=u((e=>{const t=Je(e.target);t&&o((e=>e?(e.set(t,tt(t)),new Map(e)):null))}),[]);return s((()=>{const t=n.current;if(e!==t){i(t);const a=e.map((e=>{const t=Je(e);return t?(t.addEventListener("scroll",r,{passive:!0}),[t,tt(t)]):null})).filter((e=>null!=e));o(a.length?new Map(a):null),n.current=e}return()=>{i(e),i(t)};function i(e){e.forEach((e=>{const t=Je(e);null==t||t.removeEventListener("scroll",r)}))}}),[r,e]),d((()=>e.length?t?Array.from(t.values()).reduce(((e,t)=>ve(e,t)),Me):ct(e):Me),[e,t])}(me),Oe=zt(Ee),Ce=zt(Ee,[te]),Se=ve(xe,Oe),De=se?Ye(se,xe):null,Re=N&&De?v({active:N,collisionRect:De,droppableRects:$,droppableContainers:K,pointerCoordinates:ke}):null,Ae=Fe(Re,"id"),[Te,Le]=f(null),Ne=function(e,t,o){return{...e,scaleX:t&&o?t.width/o.width:1,scaleY:t&&o?t.height/o.height:1}}(fe?xe:ve(xe,Ce),null!=(i=null==Te?void 0:Te.rect)?i:null,te),Ie=u(((e,t)=>{let{sensor:o,options:n}=t;if(null==I.current)return;const r=B.get(I.current);if(!r)return;const i=e.nativeEvent,a=new o({active:I.current,activeNode:r,event:i,options:n,context:re,onStart(e){const t=I.current;if(null==t)return;const o=B.get(t);if(!o)return;const{onDragStart:n}=U.current,r={active:{id:t,data:o.data,rect:L}};m((()=>{null==n||n(r),D(to.Initializing),O({type:Be.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:r})}))},onMove(e){O({type:Be.DragMove,coordinates:e})},onEnd:l(Be.DragEnd),onCancel:l(Be.DragCancel)});function l(e){return async function(){const{active:t,collisions:o,over:n,scrollAdjustedTranslate:r}=re.current;let a=null;if(t&&r){const{cancelDrop:l}=U.current;if(a={activatorEvent:i,active:t,collisions:o,delta:r,over:n},e===Be.DragEnd&&"function"==typeof l){await Promise.resolve(l(a))&&(e=Be.DragCancel)}}I.current=null,m((()=>{O({type:e}),D(to.Uninitialized),Le(null),F(null),H(null);const t=e===Be.DragEnd?"onDragEnd":"onDragCancel";if(a){const e=U.current[t];null==e||e(a),C({type:t,event:a})}}))}}m((()=>{F(a),H(e.nativeEvent)}))}),[B]),Pe=u(((e,t)=>(o,n)=>{const r=o.nativeEvent,i=B.get(n);if(null!==I.current||!i||r.dndKit||r.defaultPrevented)return;const a={active:i};!0===e(o,t.options,a)&&(r.dndKit={capturedBy:t.sensor},I.current=n,Ie(o,t))}),[B,Ie]),ze=function(e,t){return d((()=>e.reduce(((e,o)=>{const{sensor:n}=o;return[...e,...n.activators.map((e=>({eventName:e.eventName,handler:t(e.handler,o)})))]}),[])),[e,t])}(g,Pe);!function(e){s((()=>{if(!ee)return;const t=e.map((e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()}));return()=>{for(const e of t)null==e||e()}}),e.map((e=>{let{sensor:t}=e;return t})))}(g),ce((()=>{te&&_===to.Initializing&&D(to.Initialized)}),[te,_]),s((()=>{const{onDragMove:e}=U.current,{active:t,activatorEvent:o,collisions:n,over:r}=re.current;if(!t||!o)return;const i={active:t,activatorEvent:o,collisions:n,delta:{x:Se.x,y:Se.y},over:r};m((()=>{null==e||e(i),C({type:"onDragMove",event:i})}))}),[Se.x,Se.y]),s((()=>{const{active:e,activatorEvent:t,collisions:o,droppableContainers:n,scrollAdjustedTranslate:r}=re.current;if(!e||null==I.current||!t||!r)return;const{onDragOver:i}=U.current,a=n.get(Ae),l=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,c={active:e,activatorEvent:t,collisions:o,delta:{x:r.x,y:r.y},over:l};m((()=>{Le(l),null==i||i(c),C({type:"onDragOver",event:c})}))}),[Ae]),ce((()=>{re.current={activatorEvent:z,active:N,activeNode:q,collisionRect:De,collisions:Re,droppableRects:$,draggableNodes:B,draggingNode:le,draggingNodeRect:se,droppableContainers:T,over:Te,scrollableAncestors:me,scrollAdjustedTranslate:Se},L.current={initial:se,translated:De}}),[N,q,Re,De,B,le,se,$,T,Te,me,Se]),jt({...J,delta:A,draggingRect:De,pointerCoordinates:ke,scrollableAncestors:me,scrollableAncestorRects:be});const He=d((()=>({active:N,activeNode:q,activeNodeRect:te,activatorEvent:z,collisions:Re,containerNodeRect:oe,dragOverlay:ae,draggableNodes:B,droppableContainers:T,droppableRects:$,over:Te,measureDroppableContainers:X,scrollableAncestors:me,scrollableAncestorRects:be,measuringConfiguration:W,measuringScheduled:Z,windowRect:ge})),[N,q,te,z,Re,oe,ae,B,T,$,Te,X,me,be,W,Z,ge]),Ue=d((()=>({activatorEvent:z,activators:ze,active:N,activeNodeRect:te,ariaDescribedById:{draggable:V},dispatch:O,draggableNodes:B,over:Te,measureDroppableContainers:X})),[z,ze,N,te,O,V,B,Te,X]);return r.createElement(_e.Provider,{value:S},r.createElement(Zt.Provider,{value:Ue},r.createElement(qt.Provider,{value:He},r.createElement(eo.Provider,{value:Ne},y)),r.createElement(Qt,{disabled:!1===(null==c?void 0:c.restoreFocus)})),r.createElement(je,{...c,hiddenTextDescribedById:V}))})),no=i(null),ro="button",io="Droppable";function ao(e){let{id:t,data:o,disabled:n=!1,attributes:r}=e;const i=ye(io),{activators:l,activatorEvent:c,active:s,activeNodeRect:u,ariaDescribedById:f,draggableNodes:p,over:h}=a(Zt),{role:y=ro,roleDescription:g="draggable",tabIndex:v=0}=null!=r?r:{},m=(null==s?void 0:s.id)===t,b=a(m?eo:no),[w,x]=fe(),[k,E]=fe(),O=function(e,t){return d((()=>e.reduce(((e,o)=>{let{eventName:n,handler:r}=o;return e[n]=e=>{r(e,t)},e}),{})),[e,t])}(l,t),C=de(o);ce((()=>(p.set(t,{id:t,key:i,node:w,activatorNode:k,data:C}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)})),[p,t]);return{active:s,activatorEvent:c,activeNodeRect:u,attributes:d((()=>({role:y,tabIndex:v,"aria-disabled":n,"aria-pressed":!(!m||y!==ro)||void 0,"aria-roledescription":g,"aria-describedby":f.draggable})),[n,y,v,m,g,f.draggable]),isDragging:m,listeners:n?void 0:O,node:w,over:h,setNodeRef:x,setActivatorNodeRef:E,transform:b}}const lo="Droppable",co={timeout:25};function so(e,t,o){const n=e.slice();return n.splice(o<0?n.length+o:o,0,n.splice(t,1)[0]),n}function uo(e,t){return e.reduce(((e,o,n)=>{const r=t.get(o);return r&&(e[n]=r),e}),Array(e.length))}function fo(e){return null!==e&&e>=0}const po=e=>{let{rects:t,activeIndex:o,overIndex:n,index:r}=e;const i=so(t,n,o),a=t[r],l=i[r];return l&&a?{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}:null},ho={scaleX:1,scaleY:1},yo=e=>{var t;let{activeIndex:o,activeNodeRect:n,index:r,rects:i,overIndex:a}=e;const l=null!=(t=i[o])?t:n;if(!l)return null;if(r===o){const e=i[a];return e?{x:0,y:o<a?e.top+e.height-(l.top+l.height):e.top-l.top,...ho}:null}const c=function(e,t,o){const n=e[t],r=e[t-1],i=e[t+1];if(!n)return 0;if(o<t)return r?n.top-(r.top+r.height):i?i.top-(n.top+n.height):0;return i?i.top-(n.top+n.height):r?n.top-(r.top+r.height):0}(i,r,o);return r>o&&r<=a?{x:0,y:-l.height-c,...ho}:r<o&&r>=a?{x:0,y:l.height+c,...ho}:{x:0,y:0,...ho}};const go="Sortable",vo=r.createContext({activeIndex:-1,containerId:go,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:po,disabled:{draggable:!1,droppable:!1}});function mo(e){let{children:t,id:o,items:n,strategy:i=po,disabled:c=!1}=e;const{active:u,dragOverlay:f,droppableRects:p,over:h,measureDroppableContainers:y}=a(qt),g=ye(go,o),v=Boolean(null!==f.rect),m=d((()=>n.map((e=>"object"==typeof e&&"id"in e?e.id:e))),[n]),b=null!=u,w=u?m.indexOf(u.id):-1,x=h?m.indexOf(h.id):-1,k=l(m),E=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}(m,k.current),O=-1!==x&&-1===w||E,C=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(c);ce((()=>{E&&b&&y(m)}),[E,m,b,y]),s((()=>{k.current=m}),[m]);const S=d((()=>({activeIndex:w,containerId:g,disabled:C,disableTransforms:O,items:m,overIndex:x,useDragOverlay:v,sortedRects:uo(m,p),strategy:i})),[w,g,C.draggable,C.droppable,O,m,x,p,v,i]);return r.createElement(vo.Provider,{value:S},t)}const bo=e=>{let{id:t,items:o,activeIndex:n,overIndex:r}=e;return so(o,n,r).indexOf(t)},wo=e=>{let{containerId:t,isSorting:o,wasDragging:n,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:c,transition:s}=e;return!(!s||!n)&&((l===i||r!==a)&&(!!o||a!==r&&t===c))},xo={duration:200,easing:"ease"},ko="transform",Eo=xe.Transition.toString({property:ko,duration:0,easing:"linear"}),Oo={roleDescription:"sortable"};function Co(e){let{animateLayoutChanges:t=wo,attributes:o,disabled:n,data:r,getNewIndex:i=bo,id:c,strategy:p,resizeObserverConfig:h,transition:y=xo}=e;const{items:g,containerId:v,activeIndex:m,disabled:b,disableTransforms:w,sortedRects:x,overIndex:k,useDragOverlay:E,strategy:O}=a(vo),C=function(e,t){var o,n;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(o=null==e?void 0:e.draggable)?o:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(n,b),S=g.indexOf(c),_=d((()=>({sortable:{containerId:v,index:S,items:g},...r})),[v,r,S,g]),D=d((()=>g.slice(g.indexOf(c))),[g,c]),{rect:R,node:j,isOver:B,setNodeRef:A}=function(e){let{data:t,disabled:o=!1,id:n,resizeObserverConfig:r}=e;const i=ye(lo),{active:c,dispatch:d,over:f,measureDroppableContainers:p}=a(Zt),h=l({disabled:o}),y=l(!1),g=l(null),v=l(null),{disabled:m,updateMeasurementsFor:b,timeout:w}={...co,...r},x=de(null!=b?b:n),k=Nt({callback:u((()=>{y.current?(null!=v.current&&clearTimeout(v.current),v.current=setTimeout((()=>{p(Array.isArray(x.current)?x.current:[x.current]),v.current=null}),w)):y.current=!0}),[w]),disabled:m||!c}),E=u(((e,t)=>{k&&(t&&(k.unobserve(t),y.current=!1),e&&k.observe(e))}),[k]),[O,C]=fe(E),S=de(t);return s((()=>{k&&O.current&&(k.disconnect(),y.current=!1,k.observe(O.current))}),[O,k]),ce((()=>(d({type:Be.RegisterDroppable,element:{id:n,key:i,disabled:o,node:O,rect:g,data:S}}),()=>d({type:Be.UnregisterDroppable,key:i,id:n}))),[n]),s((()=>{o!==h.current.disabled&&(d({type:Be.SetDroppableDisabled,id:n,key:i,disabled:o}),h.current.disabled=o)}),[n,i,o,d]),{active:c,rect:g,isOver:(null==f?void 0:f.id)===n,node:O,over:f,setNodeRef:C}}({id:c,data:_,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...h}}),{active:T,activatorEvent:M,activeNodeRect:L,attributes:N,setNodeRef:I,listeners:P,isDragging:F,over:z,setActivatorNodeRef:H,transform:U}=ao({id:c,data:_,attributes:{...Oo,...o},disabled:C.draggable}),V=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>e=>{t.forEach((t=>t(e)))}),t)}(A,I),K=Boolean(T),W=K&&!w&&fo(m)&&fo(k),Y=!E&&F,$=Y&&W?U:null,X=W?null!=$?$:(null!=p?p:O)({rects:x,activeNodeRect:L,activeIndex:m,overIndex:k,index:S}):null,Z=fo(m)&&fo(k)?i({id:c,items:g,activeIndex:m,overIndex:k}):S,q=null==T?void 0:T.id,G=l({activeId:q,items:g,newIndex:Z,containerId:v}),J=g!==G.current.items,Q=t({active:T,containerId:v,isDragging:F,isSorting:K,id:c,index:S,items:g,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:y,wasDragging:null!=G.current.activeId}),ee=function(e){let{disabled:t,index:o,node:n,rect:r}=e;const[i,a]=f(null),c=l(o);return ce((()=>{if(!t&&o!==c.current&&n.current){const e=r.current;if(e){const t=Xe(n.current,{ignoreTransform:!0}),o={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(o.x||o.y)&&a(o)}}o!==c.current&&(c.current=o)}),[t,o,n,r]),s((()=>{i&&a(null)}),[i]),i}({disabled:!Q,index:S,node:j,rect:R});return s((()=>{K&&G.current.newIndex!==Z&&(G.current.newIndex=Z),v!==G.current.containerId&&(G.current.containerId=v),g!==G.current.items&&(G.current.items=g)}),[K,Z,v,g]),s((()=>{if(q===G.current.activeId)return;if(q&&!G.current.activeId)return void(G.current.activeId=q);const e=setTimeout((()=>{G.current.activeId=q}),50);return()=>clearTimeout(e)}),[q]),{active:T,activeIndex:m,attributes:N,data:_,rect:R,index:S,newIndex:Z,items:g,isOver:B,isSorting:K,isDragging:F,listeners:P,node:j,overIndex:k,over:z,setNodeRef:V,setActivatorNodeRef:H,setDroppableNodeRef:A,setDraggableNodeRef:I,transform:null!=ee?ee:X,transition:function(){if(ee||J&&G.current.newIndex===S)return Eo;if(Y&&!be(M)||!y)return;if(K||Q)return xe.Transition.toString({...y,property:ko});return}()}}function So(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const _o=[ht.Down,ht.Right,ht.Up,ht.Left],Do=(e,t)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:i,over:a,scrollableAncestors:l}}=t;if(_o.includes(e.code)){if(e.preventDefault(),!o||!n)return;const t=[];i.getEnabled().forEach((o=>{if(!o||null!=o&&o.disabled)return;const i=r.get(o.id);if(i)switch(e.code){case ht.Down:n.top<i.top&&t.push(o);break;case ht.Up:n.top>i.top&&t.push(o);break;case ht.Left:n.left>i.left&&t.push(o);break;case ht.Right:n.left<i.left&&t.push(o)}}));const c=(e=>{let{collisionRect:t,droppableRects:o,droppableContainers:n}=e;const r=Pe(t),i=[];for(const e of n){const{id:t}=e,n=o.get(t);if(n){const o=Pe(n),a=r.reduce(((e,t,n)=>e+Le(o[n],t)),0),l=Number((a/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:l}})}}return i.sort(Ne)})({active:o,collisionRect:n,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let s=Fe(c,"id");if(s===(null==a?void 0:a.id)&&c.length>1&&(s=c[1].id),null!=s){const e=i.get(o.id),t=i.get(s),a=t?r.get(t.id):null,c=null==t?void 0:t.node.current;if(c&&a&&e&&t){const o=qe(c).some(((e,t)=>l[t]!==e)),r=Ro(e,t),i=function(e,t){if(!So(e)||!So(t))return!1;if(!Ro(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),s=o||!r?{x:0,y:0}:{x:i?n.width-a.width:0,y:i?n.height-a.height:0},d={x:a.left,y:a.top};return s.x&&s.y?d:me(d,s)}}}};function Ro(e,t){return!(!So(e)||!So(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var jo;function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Bo.apply(this,arguments)}var Ao,To=function(e){return n.createElement("svg",Bo({viewBox:"0 0 10 10",fill:"currentColor",style:{width:14,height:14,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),jo||(jo=n.createElement("path",{d:"M3 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm4-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"})))};function Mo(){return Mo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Mo.apply(this,arguments)}var Lo=function(e){return n.createElement("svg",Mo({viewBox:"0 0 16 16",fill:"currentColor",style:{width:16,height:16,display:"block",flexShrink:0,backfaceVisibility:"hidden"}},e),Ao||(Ao=n.createElement("path",{d:"M7.977 14.963c.407 0 .747-.324.747-.723V8.72h5.362c.399 0 .74-.34.74-.747a.746.746 0 0 0-.74-.738H8.724V1.706c0-.398-.34-.722-.747-.722a.732.732 0 0 0-.739.722v5.529h-5.37a.746.746 0 0 0-.74.738c0 .407.341.747.74.747h5.37v5.52c0 .399.332.723.739.723z"})))};function No(e,t={}){const o=Object.keys(e.children),{at:n=e.selection}=t,r=o.find((t=>e.children[t].meta.order===(null==n?void 0:n[0])));if(r)return e.blockEditorsMap[r]}function Io(e){return zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Po(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fo(e){var t;return null==(t=(zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function zo(e){return e instanceof Node||e instanceof Po(e).Node}function Ho(e){return e instanceof Element||e instanceof Po(e).Element}function Uo(e){return e instanceof HTMLElement||e instanceof Po(e).HTMLElement}function Vo(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof Po(e).ShadowRoot)}function Ko(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Zo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Wo(e){return["table","td","th"].includes(Io(e))}function Yo(e){const t=$o(),o=Zo(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function $o(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Xo(e){return["html","body","#document"].includes(Io(e))}function Zo(e){return Po(e).getComputedStyle(e)}function qo(e){return Ho(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Go(e){if("html"===Io(e))return e;const t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||Fo(e);return Vo(t)?t.host:t}function Jo(e){const t=Go(e);return Xo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Uo(t)&&Ko(t)?t:Jo(t)}function Qo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Jo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=Po(r);return i?t.concat(a,a.visualViewport||[],Ko(r)?r:[],a.frameElement&&o?Qo(a.frameElement):[]):t.concat(r,Qo(r,[],o))}const en=Math.min,tn=Math.max,on=Math.round,nn=Math.floor,rn=e=>({x:e,y:e}),an={left:"right",right:"left",bottom:"top",top:"bottom"},ln={start:"end",end:"start"};function cn(e,t,o){return tn(e,en(t,o))}function sn(e,t){return"function"==typeof e?e(t):e}function dn(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function fn(e){return"x"===e?"y":"x"}function pn(e){return"y"===e?"height":"width"}function hn(e){return["top","bottom"].includes(dn(e))?"y":"x"}function yn(e){return fn(hn(e))}function gn(e){return e.replace(/start|end/g,(e=>ln[e]))}function vn(e){return e.replace(/left|right|bottom|top/g,(e=>an[e]))}function mn(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bn(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function wn(e,t,o){let{reference:n,floating:r}=e;const i=hn(t),a=yn(t),l=pn(a),c=dn(t),s="y"===i,d=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2,f=n[l]/2-r[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-r.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-r.width,y:u};break;default:p={x:n.x,y:n.y}}switch(un(t)){case"start":p[a]-=f*(o&&s?-1:1);break;case"end":p[a]+=f*(o&&s?-1:1)}return p}async function xn(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=sn(t,e),h=mn(p),y=l[f?"floating"===u?"reference":"floating":u],g=bn(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(y)))||o?y:y.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:d,strategy:c})),v="floating"===u?{...a.floating,x:n,y:r}:a.reference,m=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),b=await(null==i.isElement?void 0:i.isElement(m))&&await(null==i.getScale?void 0:i.getScale(m))||{x:1,y:1},w=bn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:m,strategy:c}):v);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function kn(e){const t=en(...e.map((e=>e.left))),o=en(...e.map((e=>e.top)));return{x:t,y:o,width:tn(...e.map((e=>e.right)))-t,height:tn(...e.map((e=>e.bottom)))-o}}const En=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:r,y:i,placement:a,middlewareData:l}=t,c=await async function(e,t){const{placement:o,platform:n,elements:r}=e,i=await(null==n.isRTL?void 0:n.isRTL(r.floating)),a=dn(o),l=un(o),c="y"===hn(o),s=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,u=sn(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return l&&"number"==typeof h&&(p="end"===l?-1*h:h),c?{x:p*d,y:f*s}:{x:f*s,y:p*d}}(t,e);return a===(null==(o=l.offset)?void 0:o.placement)&&null!=(n=l.arrow)&&n.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}};function On(e){const t=Zo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Uo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,l=on(o)!==i||on(n)!==a;return l&&(o=i,n=a),{width:o,height:n,$:l}}function Cn(e){return Ho(e)?e:e.contextElement}function Sn(e){const t=Cn(e);if(!Uo(t))return rn(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=On(t);let a=(i?on(o.width):o.width)/n,l=(i?on(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const _n=rn(0);function Dn(e){const t=Po(e);return $o()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_n}function Rn(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Cn(e);let a=rn(1);t&&(n?Ho(n)&&(a=Sn(n)):a=Sn(e));const l=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==Po(e))&&t}(i,o,n)?Dn(i):rn(0);let c=(r.left+l.x)/a.x,s=(r.top+l.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(i){const e=Po(i),t=n&&Ho(n)?Po(n):n;let o=e,r=o.frameElement;for(;r&&n&&t!==o;){const e=Sn(r),t=r.getBoundingClientRect(),n=Zo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,s*=e.y,d*=e.x,u*=e.y,c+=i,s+=a,o=Po(r),r=o.frameElement}}return bn({width:d,height:u,x:c,y:s})}const jn=[":popover-open",":modal"];function Bn(e){return jn.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function An(e){return Rn(Fo(e)).left+qo(e).scrollLeft}function Tn(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=Po(e),n=Fo(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,l=0,c=0;if(r){i=r.width,a=r.height;const e=$o();(!e||e&&"fixed"===t)&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:l,y:c}}(e,o);else if("document"===t)n=function(e){const t=Fo(e),o=qo(e),n=e.ownerDocument.body,r=tn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=tn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+An(e);const l=-o.scrollTop;return"rtl"===Zo(n).direction&&(a+=tn(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:l}}(Fo(e));else if(Ho(t))n=function(e,t){const o=Rn(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=Uo(e)?Sn(e):rn(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=Dn(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return bn(n)}function Mn(e,t){const o=Go(e);return!(o===t||!Ho(o)||Xo(o))&&("fixed"===Zo(o).position||Mn(o,t))}function Ln(e,t,o){const n=Uo(t),r=Fo(t),i="fixed"===o,a=Rn(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=rn(0);if(n||!n&&!i)if(("body"!==Io(t)||Ko(r))&&(l=qo(t)),n){const e=Rn(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else r&&(c.x=An(r));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Nn(e,t){return Uo(e)&&"fixed"!==Zo(e).position?t?t(e):e.offsetParent:null}function In(e,t){const o=Po(e);if(!Uo(e)||Bn(e))return o;let n=Nn(e,t);for(;n&&Wo(n)&&"static"===Zo(n).position;)n=Nn(n,t);return n&&("html"===Io(n)||"body"===Io(n)&&"static"===Zo(n).position&&!Yo(n))?o:n||function(e){let t=Go(e);for(;Uo(t)&&!Xo(t);){if(Yo(t))return t;t=Go(t)}return null}(e)||o}const Pn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Fo(n),l=!!t&&Bn(t.floating);if(n===a||l&&i)return o;let c={scrollLeft:0,scrollTop:0},s=rn(1);const d=rn(0),u=Uo(n);if((u||!u&&!i)&&(("body"!==Io(n)||Ko(a))&&(c=qo(n)),Uo(n))){const e=Rn(n);s=Sn(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-c.scrollLeft*s.x+d.x,y:o.y*s.y-c.scrollTop*s.y+d.y}},getDocumentElement:Fo,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=Qo(e,[],!1).filter((e=>Ho(e)&&"body"!==Io(e))),r=null;const i="fixed"===Zo(e).position;let a=i?Go(e):e;for(;Ho(a)&&!Xo(a);){const t=Zo(a),o=Yo(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Ko(a)&&!o&&Mn(e,a))?n=n.filter((e=>e!==a)):r=t,a=Go(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],l=i.reduce(((e,o)=>{const n=Tn(t,o,r);return e.top=tn(n.top,e.top),e.right=en(n.right,e.right),e.bottom=en(n.bottom,e.bottom),e.left=tn(n.left,e.left),e}),Tn(t,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:In,getElementRects:async function(e){const t=this.getOffsetParent||In,o=this.getDimensions;return{reference:Ln(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=On(e);return{width:t,height:o}},getScale:Sn,isElement:Ho,isRTL:function(e){return"rtl"===Zo(e).direction}};function Fn(e,t,o,n){void 0===n&&(n={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,s=Cn(e),d=r||i?[...s?Qo(s):[],...Qo(t)]:[];d.forEach((e=>{r&&e.addEventListener("scroll",o,{passive:!0}),i&&e.addEventListener("resize",o)}));const u=s&&l?function(e,t){let o,n=null;const r=Fo(e);function i(){var e;clearTimeout(o),null==(e=n)||e.disconnect(),n=null}return function a(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const{left:s,top:d,width:u,height:f}=e.getBoundingClientRect();if(l||t(),!u||!f)return;const p={rootMargin:-nn(d)+"px "+-nn(r.clientWidth-(s+u))+"px "+-nn(r.clientHeight-(d+f))+"px "+-nn(s)+"px",threshold:tn(0,en(1,c))||1};let h=!0;function y(e){const t=e[0].intersectionRatio;if(t!==c){if(!h)return a();t?a(!1,t):o=setTimeout((()=>{a(!1,1e-7)}),100)}h=!1}try{n=new IntersectionObserver(y,{...p,root:r.ownerDocument})}catch(e){n=new IntersectionObserver(y,p)}n.observe(e)}(!0),i}(s,o):null;let f,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===s&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),o()})),s&&!c&&h.observe(s),h.observe(t));let y=c?Rn(e):null;return c&&function t(){const n=Rn(e);!y||n.x===y.x&&n.y===y.y&&n.width===y.width&&n.height===y.height||o();y=n,f=requestAnimationFrame(t)}(),o(),()=>{var e;d.forEach((e=>{r&&e.removeEventListener("scroll",o),i&&e.removeEventListener("resize",o)})),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(f)}}const zn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...c}=sn(e,t),s={x:o,y:n},d=await xn(t,c),u=hn(dn(r)),f=fn(u);let p=s[f],h=s[u];if(i){const e="y"===f?"bottom":"right";p=cn(p+d["y"===f?"top":"left"],p,p-d[e])}if(a){const e="y"===u?"bottom":"right";h=cn(h+d["y"===u?"top":"left"],h,h-d[e])}const y=l.fn({...t,[f]:p,[u]:h});return{...y,data:{x:y.x-o,y:y.y-n}}}}},Hn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...g}=sn(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const v=dn(r),m=dn(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),w=f||(m||!y?[vn(l)]:function(e){const t=vn(e);return[gn(e),t,gn(t)]}(l));f||"none"===h||w.push(...function(e,t,o,n){const r=un(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(dn(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(gn)))),i}(l,y,h,b));const x=[l,...w],k=await xn(t,g),E=[];let O=(null==(n=i.flip)?void 0:n.overflows)||[];if(d&&E.push(k[v]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=un(e),r=yn(e),i=pn(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=vn(a)),[a,vn(a)]}(r,a,b);E.push(k[e[0]],k[e[1]])}if(O=[...O,{placement:r,overflows:E}],!E.every((e=>e<=0))){var C,S;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let o=null==(S=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:S.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=O.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=l}if(r!==o)return{reset:{placement:o}}}return{}}}},Un=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:r,platform:i,strategy:a}=t,{padding:l=2,x:c,y:s}=sn(e,t),d=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let n=null;for(let e=0;e<t.length;e++){const r=t[e];!n||r.y-n.y>n.height/2?o.push([r]):o[o.length-1].push(r),n=r}return o.map((e=>bn(kn(e))))}(d),f=bn(kn(d)),p=mn(l);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=s)return u.find((e=>c>e.left-p.left&&c<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||f;if(u.length>=2){if("y"===hn(o)){const e=u[0],t=u[u.length-1],n="top"===dn(o),r=e.top,i=t.bottom,a=n?e.left:t.left,l=n?e.right:t.right;return{top:r,bottom:i,left:a,right:l,width:l-a,height:i-r,x:a,y:r}}const e="left"===dn(o),t=tn(...u.map((e=>e.right))),n=en(...u.map((e=>e.left))),r=u.filter((o=>e?o.left===n:o.right===t)),i=r[0].top,a=r[r.length-1].bottom;return{top:i,bottom:a,left:n,right:t,width:t-n,height:a-i,x:n,y:i}}return f}},floating:n.floating,strategy:a});return r.reference.x!==h.reference.x||r.reference.y!==h.reference.y||r.reference.width!==h.reference.width||r.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Vn=(e,t,o)=>{const n=new Map,r={platform:Pn,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,l=i.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let s=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=wn(s,n,c),f=n,p={},h=0;for(let o=0;o<l.length;o++){const{name:i,fn:y}=l[o],{x:g,y:v,data:m,reset:b}=await y({x:d,y:u,initialPlacement:n,placement:f,strategy:r,middlewareData:p,rects:s,platform:a,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=v?v:u,p={...p,[i]:{...p[i],...m}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(s=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:d,y:u}=wn(s,f,c))),o=-1)}return{x:d,y:u,placement:f,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var Kn="undefined"!=typeof document?c:s;function Wn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,n,r;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;0!=n--;)if(!Wn(e[n],t[n]))return!1;return!0}if(r=Object.keys(e),o=r.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,r[n]))return!1;for(n=o;0!=n--;){const o=r[n];if(("_owner"!==o||!e.$$typeof)&&!Wn(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Yn(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $n(e,t){const o=Yn(e);return Math.round(t*o)/o}function Xn(e){const t=n.useRef(e);return Kn((()=>{t.current=e})),t}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
5
  */
6
- var Zn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),qn="undefined"==typeof Element,Gn=qn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jn=!qn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qn=function e(t,o){var n;void 0===o&&(o=!0);var r=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===r||"true"===r||o&&t&&e(t.parentNode)},er=function e(t,o,n){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Qn(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{Gn.call(a,Zn)&&n.filter(a)&&(o||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),d=!Qn(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},tr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},or=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!tr(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rr=function(e){return"INPUT"===e.tagName},ir=function(e){return function(e){return rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Jn(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!r||r===e}(e)},ar=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},lr=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Gn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Gn.call(r,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return ar(e)}else{if("function"==typeof n){for(var i=e;e;){var a=e.parentElement,l=Jn(e);if(a&&!a.shadowRoot&&!0===n(a))return ar(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,o,n,r,i=e&&Jn(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(o=a)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Jn(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},cr=function(e,t){return!(t.disabled||Qn(t)||function(e){return rr(e)&&"hidden"===e.type}(t)||lr(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!Gn.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},sr=function(e,t){return!(ir(t)||or(t)<0||!cr(e,t))},dr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ur=function e(t){var o=[],n=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var o=or(e);return o<0&&t&&!tr(e)?0:o}(a,i),c=i?e(t.candidates):a;0===l?i?o.push.apply(o,c):o.push(a):n.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),n.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},fr=function(e,t){var o;return o=(t=t||{}).getShadowRoot?er([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dr}):function(e,t,o){if(Qn(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Zn));return t&&Gn.call(e,Zn)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,sr.bind(null,t)),ur(o)};const pr=n["useInsertionEffect".toString()]||(e=>e());var hr="undefined"!=typeof document?c:s;function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},yr.apply(this,arguments)}let gr=!1,vr=0;const mr=()=>"floating-ui-"+vr++;const br=n["useId".toString()]||function(){const[e,t]=n.useState((()=>gr?mr():void 0));return hr((()=>{null==e&&t(mr())}),[]),n.useEffect((()=>{gr||(gr=!0)}),[]),e};const wr=n.createContext(null),xr=n.createContext(null);function kr(e){return"data-floating-ui-"+e}function Or(e){const t=l(e);return hr((()=>{t.current=e})),t}const Er=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const o=fr(e,Er());"prev"===t&&o.reverse();const n=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return o.slice(n+1)[0]}function Sr(e,t){const o=t||e.currentTarget,n=e.relatedTarget;return!n||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&Vo(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function _r(e){fr(e,Er()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Rr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function jr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Br=n.forwardRef((function(e,t){const[o,r]=n.useState();hr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",jr),()=>{document.removeEventListener("keydown",jr)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[kr("focus-guard")]:"",style:Rr};return n.createElement("span",yr({},e,i))})),Ar=n.createContext(null),Tr=kr("portal");function Mr(e){let{children:t,id:o,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:o}=void 0===e?{}:e;const[r,i]=n.useState(null),a=br(),l=Lr(),c=n.useRef(null);return hr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),hr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=a,o.setAttribute(Tr,""),e.appendChild(o),c.current=o,i(o)}),[t,a]),hr((()=>{if(c.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!Ho(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const r=document.createElement("div");r.id=a,r.setAttribute(Tr,""),e=n||e,e.appendChild(r),c.current=r,i(r)}),[t,o,a,l]),r}({id:o,root:r}),[l,c]=n.useState(null),s=n.useRef(null),d=n.useRef(null),u=n.useRef(null),f=n.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return n.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Sr(e)){("focusin"===e.type?Dr:_r)(a)}}}),[a,i,null==l?void 0:l.modal]),n.createElement(Ar.Provider,{value:n.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&n.createElement(Br,{"data-type":"outside",ref:s,onFocus:e=>{if(Sr(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&n.createElement("span",{"aria-owns":a.id,style:Rr}),a&&b(t,a),p&&a&&n.createElement(Br,{"data-type":"outside",ref:d,onFocus:e=>{if(Sr(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Lr=()=>n.useContext(Ar),Nr=new Set,Ir=n.forwardRef((function(e,t){let{lockScroll:o=!1,...r}=e;const i=br();return hr((()=>{if(!o)return;Nr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Nr.delete(i),0===Nr.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,o]),n.createElement("div",yr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Pr(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:r,nodeId:i}=e,[a,l]=n.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=n.useState(r);Wn(p,r)||h(r);const[y,g]=n.useState(null),[m,b]=n.useState(null),w=n.useCallback((e=>{e!==E.current&&(E.current=e,g(e))}),[]),x=n.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=a||y,O=l||m,E=n.useRef(null),C=n.useRef(null),S=n.useRef(u),_=null!=s,D=Xn(s),R=Xn(i),j=n.useCallback((()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:o,middleware:p};R.current&&(e.platform=R.current),Vn(E.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Wn(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,o,R]);Kn((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=n.useRef(!1);Kn((()=>(B.current=!0,()=>{B.current=!1})),[]),Kn((()=>{if(k&&(E.current=k),O&&(C.current=O),k&&O){if(D.current)return D.current(k,O,j);j()}}),[k,O,j,D,_]);const A=n.useMemo((()=>({reference:E,floating:C,setReference:w,setFloating:x})),[w,x]),T=n.useMemo((()=>({reference:k,floating:O})),[k,O]),M=n.useMemo((()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=$n(T.floating,u.x),n=$n(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Yn(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,c,T.floating,u.x,u.y]);return n.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=n.useContext(xr),u=null!=((null==(f=n.useContext(wr))?void 0:f.id)||null);var f;const p=function(e){const t=n.useRef((()=>{}));return pr((()=>{t.current=e})),n.useCallback((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(y.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==r||r(e,t,o)})),h=n.useRef(null),y=n.useRef({}),g=n.useState((()=>function(){const e=new Map;return{emit(t,o){var n;null==(n=e.get(t))||n.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter((e=>e!==o)))||[])}}}()))[0],m=br(),b=n.useCallback((e=>{const t=Ho(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=n.useCallback((e=>{(Ho(e)||null===e)&&(h.current=e,l(e)),(Ho(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Ho(e))&&s.refs.setReference(e)}),[s.refs]),x=n.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=n.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),O=n.useMemo((()=>({...s,refs:x,elements:k,dataRef:y,nodeId:i,floatingId:m,events:g,open:o,onOpenChange:p})),[s,i,m,g,o,p,x,k]);return hr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=O)})),n.useMemo((()=>({...s,context:O,refs:x,elements:k})),[s,x,k,O])}const Fr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Hr(e,t){void 0===t&&(t={});const{open:o,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=n.useState(!1),[s,d]=n.useState("unmounted"),u=function(e,t){const[o,r]=n.useState(e);return e&&!o&&r(!0),n.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),o}(o,a);return hr((()=>{l&&!u&&d("unmounted")}),[l,u]),hr((()=>{if(r){if(o){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[o,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:o={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=n.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,y]=n.useState((()=>({...zr(a,d),...zr(o,d)}))),{isMounted:g,status:v}=Hr(e,{duration:l}),m=Or(o),b=Or(r),w=Or(i),x=Or(a);return hr((()=>{const e=zr(m.current,d),t=zr(w.current,d),o=zr(x.current,d),n=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&y((t=>({transitionProperty:t.transitionProperty,...o,...e}))),"open"===v&&y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:f+"ms",...o,...n}),"close"===v){const n=t||e;y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:p+"ms",...o,...n})}}),[p,w,m,b,x,f,v,d]),{isMounted:g,styles:h}}var Vr;function Kr(){return Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Kr.apply(this,arguments)}var Wr=function(e){return n.createElement("svg",Kr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vr||(Vr=n.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Yr(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}var $r=["color"],Xr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,$r);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Zr=["color"],qr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Zr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Gr=["color"],Jr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Gr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Qr=["color"],ei=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Qr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}},oi={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var o,n,r,i,a,l,c=!1;t||(t={}),o=t.debug||!1;try{if(r=ti(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=oi[t.format]||oi.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){o&&console.error("unable to copy using execCommand: ",r),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){o&&console.error("unable to copy using clipboardData: ",r),o&&console.error("falling back to prompt"),n=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(n,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function ri(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=ri(e);return t?e[t]:void 0}const ai=i(void 0),li=({children:n,tools:r})=>{const i=K(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var o;return Object.assign(Object.assign({},e),{[t]:null===(o=r[t])||void 0===o?void 0:o.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var o,n,i;const a=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.tool,l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[r]);return e(ai.Provider,Object.assign({value:a},{children:t(o,{children:[l,n]})}))},ci=()=>{const e=a(ai);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:o,mode:n="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===n&&(t=t.filter((t=>function(e,t){var o;const n=e.blocks[t];if(!n)return!1;const r=ii(n.elements);return"void"!==(null===(o=null==r?void 0:r.props)||void 0===o?void 0:o.nodeType)}(e,t)))),t.map((t=>{var o,n,r,i;return{type:t,title:(null===(n=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===n?void 0:n.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description}}))})(),onClose:o,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===n&&e.blocks[t].toggle({focus:!0}),"create"===n&&e.blocks[t].create({deleteText:!0,focus:!0}),o()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),ui=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-border-solid yoo-editor-border-[#e5e7eb] yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),fi=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),pi=({isOpen:o,onClose:n,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:y,context:g}=Pr({placement:"right",open:u,onOpenChange:p,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:v,styles:m}=Ur(g,{duration:100});if(!o)return null;const b=N(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,O=Object.assign(Object.assign({},y),m),E=si({editor:s,view:"small",onClose:()=>{p(!1),n()}});return e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:n},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(ui,{children:[t(di,{children:[e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),n()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),n()}},{children:[e(Xr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(fi,{children:[v&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:O,ref:h.setFloating},{children:e(k,Object.assign({},E))}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=N(s);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),n()}},{children:[e(Jr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var hi=Object.freeze({__proto__:null,BlockOptions:pi,BlockOptionsMenuContent:ui,BlockOptionsMenuGroup:di,BlockOptionsMenuItem:fi,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const yi=({block:o,editor:n,dragHandleProps:r,onChangeActiveBlock:i,showActions:a})=>{const[l,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:y,actionMenuRenderProps:g,ActionMenu:v}=(({editor:e})=>{const t=ci().ActionMenu,[o,n]=f(!1),{refs:r,floatingStyles:i,context:a}=Pr({placement:"bottom-start",open:o,onOpenChange:n,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:l,styles:c}=Ur(a,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>n(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:l,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:n}),{refs:m,floatingStyles:b,context:x}=Pr({placement:"right-start",open:l,onOpenChange:c,middleware:[Un(),Hn(),zn(),On()]}),{isMounted:k,styles:O}=Ur(x,{duration:100}),{setActivatorNodeRef:E,attributes:C,listeners:D}=r,R=Object.assign(Object.assign({},b),O);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":a,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state-open="true"]:yoo-editor-opacity-100'},{children:[s&&u&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:y},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(v,Object.assign({},g))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=No(n,{at:[o.meta.order]});if(!t)return;const r=document.querySelector(`[data-yoopta-block-id="${o.id}"]`),i=S.string(t,[0]),a=ii(n.blocks[o.type].elements),l=0===i.trim().length;if(u&&l&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType))n.setSelection([o.meta.order]),n.focusBlock(o.id),d.setReference(r),h(!0);else{const e=Q({id:G()}),t=[o.meta.order+1];n.setSelection([o.meta.order]),n.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{r&&d.setReference(r.nextSibling),h(!0)}),0)}},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Lo,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{E(e),m.setReference(e)}},C,D,{onClick:e=>{e.stopPropagation(),i(o.id);const t=No(n,{at:[o.meta.order]});n.focusBlock(o.id),t&&setTimeout((()=>{n.blocks[o.type].hasCustomEditor||(w.blur(t),w.deselect(t),_.deselect(t)),n.setBlockSelected([o.meta.order],{only:!0}),n.setSelection([o.meta.order]),c(!0)}),10)}},{children:e(To,{})})),e(pi,{isOpen:k,refs:m,style:R,onClose:()=>c(!1)})]}))},gi=({children:o,block:n,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:y,isOver:g,isDragging:v}=Co({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:y,opacity:v?.7:1,marginLeft:20*n.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(n.meta.order),w=l===r,x={borderBottom:g&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":r},{children:[!a.readOnly&&e(yi,{block:n,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:o})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function vi(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});for(var bi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),wi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},xi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:bi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},ki={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Oi=1;Oi<20;Oi++)ki["f"+Oi]=111+Oi;function Ei(e,t,o){t&&!("byKey"in t)&&(o=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return Ci(e,t)})),r=function(e){return n.some((function(t){return Si(t,e)}))};return null==o?r:r(o)}function Ci(e,t){var o=t&&t.byKey,n={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in wi)n[wi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Di(f),y=wi[h];if(f.length>1&&!y&&!xi[f]&&!ki[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&y||(o?n.key=h:n.which=_i(f)),y&&(n[y]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return n}function Si(e,t){for(var o in e){var n=e[o],r=void 0;if(null!=n&&((null!=(r="key"===o&&null!=t.key?t.key.toLowerCase():"which"===o?91===n&&93===t.which?91:t.which:t[o])||!1!==n)&&r!==n))return!1}return!0}function _i(e){return e=Di(e),ki[e]||e.toUpperCase().charCodeAt(0)}function Di(e){return e=e.toLowerCase(),e=xi[e]||e}mi.default=Ei,mi.isHotkey=Ei,mi.isCodeHotkey=function(e,t){return Ei(e,t)};var Ri=mi.isKeyHotkey=function(e,t){return Ei(e,{byKey:!0},t)};mi.parseHotkey=Ci,mi.compareHotkey=Si,mi.toKeyCode=_i,mi.toKeyName=Di;const ji={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",kekCeburek:"mod+enter"},Bi={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Ai={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ti=e=>{const t=ji[e],o=Bi[e],n=Ai[e],r=t&&Ri(t),i=o&&Ri(o),a=n&&Ri(n);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Mi={isBold:Ti("bold"),isCompose:Ti("compose"),isArrowLeft:Ti("arrowLeft"),isArrowRight:Ti("arrowRight"),isArrowUp:Ti("arrowUp"),isArrowDown:Ti("arrowDown"),isDeleteBackward:Ti("deleteBackward"),isDeleteForward:Ti("deleteForward"),isDeleteLineBackward:Ti("deleteLineBackward"),isDeleteLineForward:Ti("deleteLineForward"),isDeleteWordBackward:Ti("deleteWordBackward"),isDeleteWordForward:Ti("deleteWordForward"),isExtendBackward:Ti("extendBackward"),isExtendForward:Ti("extendForward"),isExtendLineBackward:Ti("extendLineBackward"),isExtendLineForward:Ti("extendLineForward"),isItalic:Ti("italic"),isMoveLineBackward:Ti("moveLineBackward"),isMoveLineForward:Ti("moveLineForward"),isCtrlLeft:Ti("ctrlLeft"),isCtrlRight:Ti("ctrlRight"),isRedo:Ti("redo"),isShiftEnter:Ti("shiftEnter"),isEnter:Ti("enter"),isTransposeCharacter:Ti("transposeCharacter"),isUndo:Ti("undo"),isSpace:Ti("space"),isSelect:Ti("select"),isTab:Ti("tab"),isShiftTab:Ti("shiftTab"),isBackspace:Ti("backspace"),isCmdEnter:Ti("cmdEnter"),isCmd:Ti("cmd"),isEscape:Ti("escape"),isSlashCommand:Ti("slashCommand"),isShiftArrowUp:Ti("shiftArrowUp"),isShiftArrowDown:Ti("shiftArrowDown"),isKekceburek:Ti("kekCeburek")};const Li={onKeyDown:function(e){return t=>{const o=No(e,{at:e.selection});if(!o||!o.selection)return;const n=D.parent(o.selection.anchor.path);if(Mi.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void o.insertText("\n")}if(Mi.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(o,o.selection.anchor,n),i=S.isEnd(o,o.selection.anchor,n);if(!r&&!i)return void e.splitBlock({slate:o,focus:!0});const a=Q({id:G()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:o,focus:!0})}else if(Mi.isBackspace(t)){if(t.isDefaultPrevented())return;const n=N(e,{at:e.selection}),r=e.blocks[(null==n?void 0:n.type)||""],i=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,i)){t.preventDefault();const n=S.string(o,i),a=e.selection?e.selection[0]-1:0,l=No(e,{at:[a]});let c;if(l&&!r.hasCustomEditor&&(c=function(e,t){const[,o]=S.last(e,t);return{path:o,offset:S.string(e,o).length}}(l,i)),0===n.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:c});{if(R.isExpanded(o.selection))return _.delete(o,{at:o.selection});if(!l)return;if(0===S.string(l,[0,0]).length)return e.deleteBlock({at:[a],focus:!0,focusAt:c});const t=Array.from(S.nodes(o,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(o,e)),mode:"highest"})).map((([e])=>e));return _.insertNodes(l,t,{at:S.end(l,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:c})}}}else{if(Mi.isSelect(t)){if(t.isDefaultPrevented())return;const[,n]=S.first(o,[0]),[,r]=S.last(o,[o.children.length-1]),i=S.range(o,n,r),a=R.equals(o.selection,i);if(R.isExpanded(o.selection)&&a)return t.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),void e.setBlockSelected([],{allSelected:!0})}if(Mi.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Mi.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Mi.isArrowUp(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]-1]:null,n=No(e,{at:o}),r=N(e,{at:o});if(n&&r){const[,o]=S.last(n,[0]),i={path:o,offset:S.string(n,o).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Mi.isArrowDown(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isEnd(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]+1]:null,r=No(e,{at:o}),i=N(e,{at:o});if(r&&i){const o=function(e,t){const[,o]=S.first(e,t);return{path:o,offset:0}}(r,n);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:o,waitExecution:!1})}}}if(R.isExpanded(o.selection)){if(Object.values(e.formats).length>0)for(const o of Object.values(e.formats))if(o.hotkey&&Ri(o.hotkey)(t)){t.preventDefault(),e.formats[o.type].toggle();break}}}}}},Ni=({children:t,attributes:o,placeholder:n})=>{const r=x(),i=Object.assign({},o);return r&&n&&(i["data-placeholder"]=n,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Ii(e){try{return new URL(e),!0}catch(e){return!1}}const Pi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{_.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:o}=e,n=o&&R.isCollapsed(o),r={type:"link",children:n?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};n?_.insertNodes(e,r):(_.wrapNodes(e,r,{split:!0}),_.collapse(e,{edge:"end"}))};function Fi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const zi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Hi(e,t,o){var n,r,i;if(3===o.nodeType){return null===(n=o.textContent)||void 0===n?void 0:n.replace(/[\t\n\r\f\v]+/g," ")}if(1!==o.nodeType)return null;if("BR"===o.nodeName)return"\n";const a=o;let l=Array.from(a.childNodes).map((o=>Hi(e,t,o))).flat();if(zi[o.nodeName]){return{[zi[o.nodeName].type]:!0,text:null===(r=o.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[o.nodeName]){const n=t[o.nodeName],r=e.blocks[n.type],a=ri(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Ui),props:Object.assign({nodeType:"block"},c.props)};if(n.parse){const e=n.parse(o);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:n.type,value:[d],meta:{order:0,depth:0}})}return l}function Ui(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Fi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Vi={html:{deserialize:function(e,t){console.log("pasted html",t);const o=function(e){const t={};return Object.keys(e.plugins).forEach((o=>{const n=e.plugins[o],{parsers:r}=n;if(r){const{html:e}=r;if(e){const{deserialize:n}=e;if(n){const{nodeNames:e}=n;e&&e.forEach((e=>{t[e]={type:o,parse:n.parse}}))}}}})),t}(e);return Hi(e,o,t).filter(Fi)},serialize:function(){}},markdown:{}},Ki=({id:t,customEditor:o,elements:n,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),y=H(t),g=l(y.value).current,v=y.type,m=d((()=>(e=>{const t={};return Object.keys(e).forEach((o=>t[o]=e[o].render)),t})(n)),[n]),b=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),w=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(n).forEach((t=>{var o;const r=null===(o=n[t].props)||void 0===o?void 0:o.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:o}=e;return e.insertText=t=>{t&&Ii(t)?Pi(e,t):o(t)},e.insertData=o=>{const n=o.getData("text/plain");n&&Ii(n)?Pi(e,n):t(o)},e})(e))})),e}),[]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Mi,currentBlock:y,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((o=>{t[o]=function(t){if(i[o]){i[o](h,w,e)(t)}}})),t}),[i,h,y]),k=u((e=>h.updateBlock(t,{value:e})),[t]),O=u((o=>{const n=m[o.element.type];return n?e(n,Object.assign({},o,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(E,Object.assign({},o))}),[n]),C=u((t=>{var o,n,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=vi(s,["text"]),f=(null===(o=h.selection)||void 0===o?void 0:o[0])===y.meta.order;u&&Object.keys(u).forEach((e=>{const t=b[e];t&&(l=t.render({children:l,leaf:s}))}));const p=!("void"===(null===(a=null===(i=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Ni,Object.assign({attributes:d,placeholder:p?c:void 0},{children:l}))}),[r]),_=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),Li.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],y.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),j=u((e=>{var t,o;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==y.meta.order&&h.setSelection([y.meta.order]),null===(o=null==x?void 0:x.onClick)||void 0===o||o.call(x,e))}),[x.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],y.meta.order]),B=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),A=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e)}),[x.onFocus,h.readOnly]),T=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const o=e.clipboardData.getData("text/html"),n=(new DOMParser).parseFromString(o,"text/html");if(n.body.childNodes.length>0){const e=Vi.html.deserialize(h,n.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),M=u((e=>{var t;const o=[];if(h.readOnly)return o;const[n,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===y.meta.order;return w.selection&&i&&!S.isEditor(n)&&""===S.string(w,[r[0]])&&R.includes(w.selection,r)&&R.isCollapsed(w.selection)&&o.push(Object.assign(Object.assign({},w.selection),{withPlaceholder:!0})),o}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],y.meta.order]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":v},{children:e(Wi,{id:t,slate:w,initialValue:g,onChange:k,decorate:M,renderLeaf:C,renderElement:O,eventHandlers:x,onKeyDown:_,onKeyUp:D,onFocus:A,onClick:j,onBlur:B,customEditor:o,readOnly:h.readOnly,onPaste:T})}))},Wi=p((({id:t,slate:o,initialValue:n,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:y,readOnly:g})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:o,initialValue:n,onChange:r},{children:e(O,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:y,onBlur:f,readOnly:g,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Wi.displayName="SlateEditorInstance";const Yi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Te(Et,{activationConstraint:{delay:100,tolerance:0}}),Te(bt,{coordinateGetter:Do})),handleDragEnd:u((t=>{const{active:o,over:n}=t;if(o&&n&&o.id!==n.id){const t=e.children[n.id].meta.order;e.moveBlock(o.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),$i=[],Xi=({editor:t,marks:n,placeholder:r})=>{const i=K(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Yi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?$i:s.sort(((e,o)=>t.children[e].meta.order-t.children[o].meta.order))),[s]),f=[];for(let o=0;o<u.length;o++){const i=u[o],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(gi,Object.assign({block:a,blockId:i},{children:e(Ki,{type:a.type,id:i,marks:n,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(o,{children:f}):e(oo,Object.assign({sensors:a,collisionDetection:He,onDragStart:c,onDragEnd:l},{children:e(mo,Object.assign({disabled:i,items:u,strategy:yo},{children:f}))}))},Zi=({editor:e,yooptaEditorRef:t,root:o})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===o)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!n.selection||e.readOnly||!1===o)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const o=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((n,r)=>{if(!n)return;const i=n.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&o.push(r)})),o})(n.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===o)return;const r=o&&"current"in o?o.current:o||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=t.current)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,o,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},qi=({origin:t,coords:o,isOpen:n})=>{if(!n)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(o[1]-t[1]-1),width:Math.abs(o[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>o[1]&&t[0]>o[0]?"scaleY(-1) scaleX(-1)":t[1]>o[1]?"scaleY(-1)":t[0]>o[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Gi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Ji=({placeholder:o,marks:n,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=K(),f=l(null),p=Zi({editor:d,yooptaEditorRef:f,root:i});let h=l(Gi).current;s((()=>{if(!c||u)return;const e=N(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const y=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},g=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,o,n,r,i;if(!u){if(Mi.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Mi.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void g();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void g()}if(Mi.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),i=S.isStart(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&i){const n=d.selection?[d.selection[0]-1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Mi.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),r=S.isEnd(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&r){const n=d.selection?[d.selection[0]+1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(g(),(e=>{var t;const o=f.current;if(!o)return;const{bottom:n}=o.getBoundingClientRect(),r=n-parseInt(getComputedStyle(o).paddingBottom,10),i=Q({id:G()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,o=N(d,{at:[e]}),n=No(d,{at:[e]});if(o&&n&&n.selection){const e=S.string(n,n.selection.anchor.path),r=D.parent(n.selection.anchor.path),[a]=S.node(n,r);if(o.type===i.type&&B.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(o.id,{slate:n})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),y())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(g(),y())}},{children:[e(Xi,{editor:d,marks:n,placeholder:o}),!1!==i&&e(qi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Qi=({children:e,fallback:t=null})=>{const[o,n]=f(!1);return s((()=>n(!0)),[]),o?e:t};
6
+ var Zn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),qn="undefined"==typeof Element,Gn=qn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Jn=!qn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qn=function e(t,o){var n;void 0===o&&(o=!0);var r=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===r||"true"===r||o&&t&&e(t.parentNode)},er=function e(t,o,n){for(var r=[],i=Array.from(t);i.length;){var a=i.shift();if(!Qn(a,!1))if("SLOT"===a.tagName){var l=a.assignedElements(),c=e(l.length?l:a.children,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:a,candidates:c})}else{Gn.call(a,Zn)&&n.filter(a)&&(o||!t.includes(a))&&r.push(a);var s=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),d=!Qn(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(s&&d){var u=e(!0===s?a.children:s.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},tr=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},or=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!tr(e)?0:e.tabIndex},nr=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},rr=function(e){return"INPUT"===e.tagName},ir=function(e){return function(e){return rr(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Jn(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var r=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!r||r===e}(e)},ar=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},lr=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var r=Gn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Gn.call(r,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return ar(e)}else{if("function"==typeof n){for(var i=e;e;){var a=e.parentElement,l=Jn(e);if(a&&!a.shadowRoot&&!0===n(a))return ar(e);e=e.assignedSlot?e.assignedSlot:a||l===e.ownerDocument?a:l.host}e=i}if(function(e){var t,o,n,r,i=e&&Jn(e),a=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(o=a)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(a)||null!=e&&null!==(r=e.ownerDocument)&&void 0!==r&&r.contains(e));!l&&a;){var c,s,d;l=!(null===(s=a=null===(c=i=Jn(a))||void 0===c?void 0:c.host)||void 0===s||null===(d=s.ownerDocument)||void 0===d||!d.contains(a))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},cr=function(e,t){return!(t.disabled||Qn(t)||function(e){return rr(e)&&"hidden"===e.type}(t)||lr(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!Gn.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},sr=function(e,t){return!(ir(t)||or(t)<0||!cr(e,t))},dr=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ur=function e(t){var o=[],n=[];return t.forEach((function(t,r){var i=!!t.scopeParent,a=i?t.scopeParent:t,l=function(e,t){var o=or(e);return o<0&&t&&!tr(e)?0:o}(a,i),c=i?e(t.candidates):a;0===l?i?o.push.apply(o,c):o.push(a):n.push({documentOrder:r,tabIndex:l,item:t,isScope:i,content:c})})),n.sort(nr).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},fr=function(e,t){var o;return o=(t=t||{}).getShadowRoot?er([e],t.includeContainer,{filter:sr.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dr}):function(e,t,o){if(Qn(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Zn));return t&&Gn.call(e,Zn)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,sr.bind(null,t)),ur(o)};const pr=n["useInsertionEffect".toString()]||(e=>e());var hr="undefined"!=typeof document?c:s;function yr(){return yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},yr.apply(this,arguments)}let gr=!1,vr=0;const mr=()=>"floating-ui-"+vr++;const br=n["useId".toString()]||function(){const[e,t]=n.useState((()=>gr?mr():void 0));return hr((()=>{null==e&&t(mr())}),[]),n.useEffect((()=>{gr||(gr=!0)}),[]),e};const wr=n.createContext(null),xr=n.createContext(null);function kr(e){return"data-floating-ui-"+e}function Er(e){const t=l(e);return hr((()=>{t.current=e})),t}const Or=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Cr(e,t){const o=fr(e,Or());"prev"===t&&o.reverse();const n=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(r=e)?void 0:r.ownerDocument)||document));var r;return o.slice(n+1)[0]}function Sr(e,t){const o=t||e.currentTarget,n=e.relatedTarget;return!n||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&Vo(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function _r(e){fr(e,Or()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dr(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Rr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function jr(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Br=n.forwardRef((function(e,t){const[o,r]=n.useState();hr((()=>(/apple/i.test(navigator.vendor)&&r("button"),document.addEventListener("keydown",jr),()=>{document.removeEventListener("keydown",jr)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[kr("focus-guard")]:"",style:Rr};return n.createElement("span",yr({},e,i))})),Ar=n.createContext(null),Tr=kr("portal");function Mr(e){let{children:t,id:o,root:r=null,preserveTabOrder:i=!0}=e;const a=function(e){let{id:t,root:o}=void 0===e?{}:e;const[r,i]=n.useState(null),a=br(),l=Lr(),c=n.useRef(null);return hr((()=>()=>{null==r||r.remove(),queueMicrotask((()=>{c.current=null}))}),[r]),hr((()=>{if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=a,o.setAttribute(Tr,""),e.appendChild(o),c.current=o,i(o)}),[t,a]),hr((()=>{if(c.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!Ho(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const r=document.createElement("div");r.id=a,r.setAttribute(Tr,""),e=n||e,e.appendChild(r),c.current=r,i(r)}),[t,o,a,l]),r}({id:o,root:r}),[l,c]=n.useState(null),s=n.useRef(null),d=n.useRef(null),u=n.useRef(null),f=n.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!r&&!a);return n.useEffect((()=>{if(a&&i&&(null==l||!l.modal))return a.addEventListener("focusin",e,!0),a.addEventListener("focusout",e,!0),()=>{a.removeEventListener("focusin",e,!0),a.removeEventListener("focusout",e,!0)};function e(e){if(a&&Sr(e)){("focusin"===e.type?Dr:_r)(a)}}}),[a,i,null==l?void 0:l.modal]),n.createElement(Ar.Provider,{value:n.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:c})),[i,a])},p&&a&&n.createElement(Br,{"data-type":"outside",ref:s,onFocus:e=>{if(Sr(e,a)){var t;null==(t=u.current)||t.focus()}else{const e=Cr(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&a&&n.createElement("span",{"aria-owns":a.id,style:Rr}),a&&b(t,a),p&&a&&n.createElement(Br,{"data-type":"outside",ref:d,onFocus:e=>{if(Sr(e,a)){var t;null==(t=f.current)||t.focus()}else{const t=Cr(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const Lr=()=>n.useContext(Ar),Nr=new Set,Ir=n.forwardRef((function(e,t){let{lockScroll:o=!1,...r}=e;const i=br();return hr((()=>{if(!o)return;Nr.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,l=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(o))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Nr.delete(i),0===Nr.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,l)))}}),[i,o]),n.createElement("div",yr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))}));function Pr(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:r,nodeId:i}=e,[a,l]=n.useState(null),c=(null==(t=e.elements)?void 0:t.reference)||a,s=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:s,open:d}=e,[u,f]=n.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=n.useState(r);Wn(p,r)||h(r);const[y,g]=n.useState(null),[m,b]=n.useState(null),w=n.useCallback((e=>{e!==O.current&&(O.current=e,g(e))}),[]),x=n.useCallback((e=>{e!==C.current&&(C.current=e,b(e))}),[]),k=a||y,E=l||m,O=n.useRef(null),C=n.useRef(null),S=n.useRef(u),_=null!=s,D=Xn(s),R=Xn(i),j=n.useCallback((()=>{if(!O.current||!C.current)return;const e={placement:t,strategy:o,middleware:p};R.current&&(e.platform=R.current),Vn(O.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};B.current&&!Wn(S.current,t)&&(S.current=t,v.flushSync((()=>{f(t)})))}))}),[p,t,o,R]);Kn((()=>{!1===d&&S.current.isPositioned&&(S.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const B=n.useRef(!1);Kn((()=>(B.current=!0,()=>{B.current=!1})),[]),Kn((()=>{if(k&&(O.current=k),E&&(C.current=E),k&&E){if(D.current)return D.current(k,E,j);j()}}),[k,E,j,D,_]);const A=n.useMemo((()=>({reference:O,floating:C,setReference:w,setFloating:x})),[w,x]),T=n.useMemo((()=>({reference:k,floating:E})),[k,E]),M=n.useMemo((()=>{const e={position:o,left:0,top:0};if(!T.floating)return e;const t=$n(T.floating,u.x),n=$n(T.floating,u.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...Yn(T.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,c,T.floating,u.x,u.y]);return n.useMemo((()=>({...u,update:j,refs:A,elements:T,floatingStyles:M})),[u,j,A,T,M])}(e),d=n.useContext(xr),u=null!=((null==(f=n.useContext(wr))?void 0:f.id)||null);var f;const p=function(e){const t=n.useRef((()=>{}));return pr((()=>{t.current=e})),n.useCallback((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(y.current.openEvent=t),g.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==r||r(e,t,o)})),h=n.useRef(null),y=n.useRef({}),g=n.useState((()=>function(){const e=new Map;return{emit(t,o){var n;null==(n=e.get(t))||n.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter((e=>e!==o)))||[])}}}()))[0],m=br(),b=n.useCallback((e=>{const t=Ho(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s.refs.setReference(t)}),[s.refs]),w=n.useCallback((e=>{(Ho(e)||null===e)&&(h.current=e,l(e)),(Ho(s.refs.reference.current)||null===s.refs.reference.current||null!==e&&!Ho(e))&&s.refs.setReference(e)}),[s.refs]),x=n.useMemo((()=>({...s.refs,setReference:w,setPositionReference:b,domReference:h})),[s.refs,w,b]),k=n.useMemo((()=>({...s.elements,domReference:c})),[s.elements,c]),E=n.useMemo((()=>({...s,refs:x,elements:k,dataRef:y,nodeId:i,floatingId:m,events:g,open:o,onOpenChange:p})),[s,i,m,g,o,p,x,k]);return hr((()=>{const e=null==d?void 0:d.nodesRef.current.find((e=>e.id===i));e&&(e.context=E)})),n.useMemo((()=>({...s,context:E,refs:x,elements:k})),[s,x,k,E])}const Fr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function zr(e,t){return"function"==typeof e?e(t):e}function Hr(e,t){void 0===t&&(t={});const{open:o,elements:{floating:r}}=e,{duration:i=250}=t,a=("number"==typeof i?i:i.close)||0,[l,c]=n.useState(!1),[s,d]=n.useState("unmounted"),u=function(e,t){const[o,r]=n.useState(e);return e&&!o&&r(!0),n.useEffect((()=>{if(!e){const e=setTimeout((()=>r(!1)),t);return()=>clearTimeout(e)}}),[e,t]),o}(o,a);return hr((()=>{l&&!u&&d("unmounted")}),[l,u]),hr((()=>{if(r){if(o){d("initial");const e=requestAnimationFrame((()=>{d("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),d("close")}}),[o,r]),{isMounted:u,status:s}}function Ur(e,t){void 0===t&&(t={});const{initial:o={opacity:0},open:r,close:i,common:a,duration:l=250}=t,c=e.placement,s=c.split("-")[0],d=n.useMemo((()=>({side:s,placement:c})),[s,c]),u="number"==typeof l,f=(u?l:l.open)||0,p=(u?l:l.close)||0,[h,y]=n.useState((()=>({...zr(a,d),...zr(o,d)}))),{isMounted:g,status:v}=Hr(e,{duration:l}),m=Er(o),b=Er(r),w=Er(i),x=Er(a);return hr((()=>{const e=zr(m.current,d),t=zr(w.current,d),o=zr(x.current,d),n=zr(b.current,d)||Object.keys(e).reduce(((e,t)=>(e[t]="",e)),{});if("initial"===v&&y((t=>({transitionProperty:t.transitionProperty,...o,...e}))),"open"===v&&y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:f+"ms",...o,...n}),"close"===v){const n=t||e;y({transitionProperty:Object.keys(n).map(Fr).join(","),transitionDuration:p+"ms",...o,...n})}}),[p,w,m,b,x,f,v,d]),{isMounted:g,styles:h}}var Vr;function Kr(){return Kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Kr.apply(this,arguments)}var Wr=function(e){return n.createElement("svg",Kr({viewBox:"0 0 16 16",className:"turn_svg__loop",style:{width:16,height:16,display:"block",fill:"currentcolor",flexShrink:0,backfaceVisibility:"hidden"}},e),Vr||(Vr=n.createElement("path",{d:"M5.804 3.123c.006.38.254.622.673.622h4.887c.59 0 .914.305.914.92v6.628l-.901-.978-.514-.514c-.267-.254-.629-.273-.895-.013-.254.26-.248.635.012.895l2.165 2.158c.476.47 1.022.47 1.498 0l2.165-2.158c.26-.26.266-.635.012-.895-.266-.26-.628-.241-.895.013l-.514.514-.895.971V4.564c0-1.358-.71-2.063-2.082-2.063H6.477c-.42 0-.68.241-.673.622ZM.186 7.06c.26.266.622.247.889-.013l.52-.508.889-.971v6.722c0 1.359.71 2.063 2.082 2.063h4.957c.42 0 .68-.241.673-.622-.006-.387-.254-.622-.673-.622h-4.88c-.591 0-.915-.311-.915-.927V5.554l.895.984.52.508c.26.26.629.28.89.013.26-.26.253-.629-.013-.89L3.855 4.013c-.476-.476-1.016-.476-1.492 0L.2 6.17c-.267.26-.273.628-.013.889Z"})))};function Yr(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}var $r=["color"],Xr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,$r);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Zr=["color"],qr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Zr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Gr=["color"],Jr=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Gr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M8.51194 3.00541C9.18829 2.54594 10.0435 2.53694 10.6788 2.95419C10.8231 3.04893 10.9771 3.1993 11.389 3.61119C11.8009 4.02307 11.9513 4.17714 12.046 4.32141C12.4633 4.95675 12.4543 5.81192 11.9948 6.48827C11.8899 6.64264 11.7276 6.80811 11.3006 7.23511L10.6819 7.85383C10.4867 8.04909 10.4867 8.36567 10.6819 8.56093C10.8772 8.7562 11.1938 8.7562 11.389 8.56093L12.0077 7.94221L12.0507 7.89929C12.4203 7.52976 12.6568 7.2933 12.822 7.0502C13.4972 6.05623 13.5321 4.76252 12.8819 3.77248C12.7233 3.53102 12.4922 3.30001 12.1408 2.94871L12.0961 2.90408L12.0515 2.85942C11.7002 2.508 11.4692 2.27689 11.2277 2.11832C10.2377 1.46813 8.94398 1.50299 7.95001 2.17822C7.70691 2.34336 7.47044 2.57991 7.1009 2.94955L7.058 2.99247L6.43928 3.61119C6.24401 3.80645 6.24401 4.12303 6.43928 4.31829C6.63454 4.51355 6.95112 4.51355 7.14638 4.31829L7.7651 3.69957C8.1921 3.27257 8.35757 3.11027 8.51194 3.00541ZM4.31796 7.14672C4.51322 6.95146 4.51322 6.63487 4.31796 6.43961C4.12269 6.24435 3.80611 6.24435 3.61085 6.43961L2.99213 7.05833L2.94922 7.10124C2.57957 7.47077 2.34303 7.70724 2.17788 7.95035C1.50265 8.94432 1.4678 10.238 2.11799 11.2281C2.27656 11.4695 2.50766 11.7005 2.8591 12.0518L2.90374 12.0965L2.94837 12.1411C3.29967 12.4925 3.53068 12.7237 3.77214 12.8822C4.76219 13.5324 6.05589 13.4976 7.04986 12.8223C7.29296 12.6572 7.52943 12.4206 7.89896 12.051L7.89897 12.051L7.94188 12.0081L8.5606 11.3894C8.75586 11.1941 8.75586 10.8775 8.5606 10.6823C8.36533 10.487 8.04875 10.487 7.85349 10.6823L7.23477 11.301C6.80777 11.728 6.6423 11.8903 6.48794 11.9951C5.81158 12.4546 4.95642 12.4636 4.32107 12.0464C4.17681 11.9516 4.02274 11.8012 3.61085 11.3894C3.19896 10.9775 3.0486 10.8234 2.95385 10.6791C2.53661 10.0438 2.54561 9.18863 3.00507 8.51227C3.10993 8.35791 3.27224 8.19244 3.69924 7.76544L4.31796 7.14672ZM9.62172 6.08558C9.81698 5.89032 9.81698 5.57373 9.62172 5.37847C9.42646 5.18321 9.10988 5.18321 8.91461 5.37847L5.37908 8.91401C5.18382 9.10927 5.18382 9.42585 5.37908 9.62111C5.57434 9.81637 5.89092 9.81637 6.08619 9.62111L9.62172 6.08558Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),Qr=["color"],ei=y((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,r=Yr(e,Qr);return g("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),g("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),ti=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,o=[],n=0;n<e.rangeCount;n++)o.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||o.forEach((function(t){e.addRange(t)})),t&&t.focus()}},oi={"text/plain":"Text","text/html":"Url",default:"Text"};var ni=function(e,t){var o,n,r,i,a,l,c=!1;t||(t={}),o=t.debug||!1;try{if(r=ti(),i=document.createRange(),a=document.getSelection(),(l=document.createElement("span")).textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){o&&console.warn("unable to use e.clipboardData"),o&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=oi[t.format]||oi.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))})),document.body.appendChild(l),i.selectNodeContents(l),a.addRange(i),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");c=!0}catch(r){o&&console.error("unable to copy using execCommand: ",r),o&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(r){o&&console.error("unable to copy using clipboardData: ",r),o&&console.error("falling back to prompt"),n=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(n,e)}}finally{a&&("function"==typeof a.removeRange?a.removeRange(i):a.removeAllRanges()),l&&document.body.removeChild(l),r()}return c};function ri(e){if(!e)return;const t=Object.keys(e);return 1===t.length?t[0]:t.find((t=>e[t].asRoot))}function ii(e){if(!e)return;const t=ri(e);return t?e[t]:void 0}const ai=i(void 0),li=({children:n,tools:r})=>{const i=K(),a=d((()=>r?Object.keys(r).reduce(((e,t)=>{var o;return Object.assign(Object.assign({},e),{[t]:null===(o=r[t])||void 0===o?void 0:o.render})}),{}):{}),[r]),l=d((()=>!r||i?null:Object.keys(r).map((t=>{var o,n,i;const a=null===(o=null==r?void 0:r[t])||void 0===o?void 0:o.tool,l=null===(n=null==r?void 0:r[t])||void 0===n?void 0:n.render,c=null===(i=null==r?void 0:r[t])||void 0===i?void 0:i.props;return a?e(a,Object.assign({render:l},c),t):null}))),[r]);return e(ai.Provider,Object.assign({value:a},{children:t(o,{children:[l,n]})}))},ci=()=>{const e=a(ai);if(void 0===e)throw new Error("useYooptaTools must be used within a ToolsProvider");return e};function si({editor:e,view:t,onClose:o,mode:n="toggle"}){return{actions:(()=>{let t=Object.keys(e.blocks);return"toggle"===n&&(t=t.filter((t=>function(e,t){var o;const n=e.blocks[t];if(!n)return!1;const r=ii(n.elements);return"void"!==(null===(o=null==r?void 0:r.props)||void 0===o?void 0:o.nodeType)}(e,t)))),t.map((t=>{var o,n,r,i;return{type:t,title:(null===(n=null===(o=e.blocks[t].options)||void 0===o?void 0:o.display)||void 0===n?void 0:n.title)||t,description:null===(i=null===(r=e.blocks[t].options)||void 0===r?void 0:r.display)||void 0===i?void 0:i.description}}))})(),onClose:o,empty:!1,getItemProps:t=>({onMouseEnter:()=>{},"data-action-menu-item":!0,"data-action-menu-item-type":t,"aria-selected":!1,onClick:()=>{"toggle"===n&&e.blocks[t].toggle({focus:!0}),"create"===n&&e.blocks[t].create({deleteText:!0,focus:!0}),o()}}),getRootProps:()=>({"data-action-menu-list":!0}),editor:e,view:t}}const di=({children:t})=>e("div",Object.assign({className:"yoo-editor-flex yoo-editor-flex-col"},{children:t})),ui=({children:t})=>e("div",Object.assign({onClick:e=>e.stopPropagation(),className:"yoo-editor-bg-[#FFF] yoo-editor-relative yoo-editor-min-w-[200px] yoo-editor-w-auto yoo-editor-overflow-hidden yoo-editor-rounded-md yoo-editor-border yoo-editor-border-solid yoo-editor-border-[#e5e7eb] yoo-editor-bg-popover yoo-editor-py-[6px] yoo-editor-px-0 yoo-editor-text-popover-foreground yoo-editor-shadow-md data-[state=open]:yoo-editor-animate-in data-[state=closed]:yoo-editor-animate-out data-[state=closed]:yoo-editor-fade-out-0 data-[state=open]:yoo-editor-fade-in-0 data-[state=closed]:yoo-editor-zoom-out-95 data-[state=open]:yoo-editor-zoom-in-95 data-[side=bottom]:yoo-editor-slide-in-from-top-2 data-[side=left]:yoo-editor-slide-in-from-right-2 data-[side=right]:yoo-editor-slide-in-from-left-2 data-[side=top]:yoo-editor-slide-in-from-bottom-2"},{children:t})),fi=({children:t})=>e("div",Object.assign({className:"yoo-editor-relative yoo-editor-flex yoo-editor-cursor-default yoo-editor-select-none yoo-editor-items-center yoo-editor-text-sm yoo-editor-outline-none yoo-editor-transition-colors focus:yoo-editor-bg-accent focus:yoo-editor-text-accent-foreground data-[disabled]:yoo-editor-pointer-events-none data-[disabled]:yoo-editor-opacity-50"},{children:t})),pi=({isOpen:o,onClose:n,refs:r,style:i,children:a})=>{var l,c;const s=z(),d=ci(),[u,p]=f(!1),{refs:h,floatingStyles:y,context:g}=Pr({placement:"right",open:u,onOpenChange:p,middleware:[Un(),Hn(),zn(),En(10)],whileElementsMounted:Fn}),{isMounted:v,styles:m}=Ur(g,{duration:100});if(!o)return null;const b=N(s,{at:s.selection}),w=ii(s.blocks[(null==b?void 0:b.type)||""].elements),x="void"===(null===(l=null==w?void 0:w.props)||void 0===l?void 0:l.nodeType),k=d.ActionMenu,E=Object.assign(Object.assign({},y),m),O=si({editor:s,view:"small",onClose:()=>{p(!1),n()}});return e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:n},{children:e("div",Object.assign({style:i,ref:r.setFloating},{children:t(ui,{children:[t(di,{children:[e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=s.selection;s.deleteBlock({at:e}),s.setBlockSelected(null),s.setSelection(null),n()}},{children:[e(ei,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Delete"]}))}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{s.duplicateBlock({at:s.selection,focus:!0}),s.setBlockSelected(null),n()}},{children:[e(Xr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Duplicate"]}))}),!!k&&!x&&!(null===(c=s.blocks[(null==b?void 0:b.type)||""])||void 0===c?void 0:c.hasCustomEditor)&&t(fi,{children:[v&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:()=>p(!1)},{children:e("div",Object.assign({style:E,ref:h.setFloating},{children:e(k,Object.assign({},O))}))}))})),t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",ref:h.setReference,onClick:()=>p((e=>!e))},{children:[e(Wr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Turn into"]}))]}),e(fi,{children:t("button",Object.assign({type:"button",className:"yoo-editor-rounded-sm hover:yoo-editor-bg-[#37352f14] yoo-editor-leading-[120%] yoo-editor-px-2 yoo-editor-py-1.5 yoo-editor-mx-[4px] yoo-editor-cursor-pointer yoo-editor-w-full yoo-editor-flex yoo-editor-justify-start",onClick:()=>{const e=N(s);e&&(ni(`${window.location.origin}${window.location.pathname}#${e.id}`),s.emit("block:copy",e)),n()}},{children:[e(Jr,{className:"yoo-editor-w-4 yoo-editor-h-4 yoo-editor-mr-2"}),"Copy link to block"]}))})]}),a]})}))}))}))};var hi=Object.freeze({__proto__:null,BlockOptions:pi,BlockOptionsMenuContent:ui,BlockOptionsMenuGroup:di,BlockOptionsMenuItem:fi,BlockOptionsSeparator:({className:t})=>e("div",{className:`yoo-editor-h-[1px] yoo-editor-bg-[#37352f14] yoo-editor-my-[4px] yoo-editor-w-full ${t}`})});const yi=({block:o,editor:n,dragHandleProps:r,onChangeActiveBlock:i,showActions:a})=>{const[l,c]=f(!1),{isActionMenuOpen:s,actionMenuRefs:d,hasActionMenu:u,actionMenuStyles:p,onChangeActionMenuOpen:h,onCloseActionMenu:y,actionMenuRenderProps:g,ActionMenu:v}=(({editor:e})=>{const t=ci().ActionMenu,[o,n]=f(!1),{refs:r,floatingStyles:i,context:a}=Pr({placement:"bottom-start",open:o,onOpenChange:n,middleware:[Un(),Hn(),zn(),En(10)],whileElementsMounted:Fn}),{isMounted:l,styles:c}=Ur(a,{duration:100}),s=Object.assign(Object.assign({},i),c),d=e=>n(e),u=()=>d(!1),p=si({editor:e,view:"default",mode:"create",onClose:u});return{isActionMenuOpen:l,actionMenuStyles:s,actionMenuRefs:r,hasActionMenu:!!t,onChangeActionMenuOpen:d,actionMenuRenderProps:p,onCloseActionMenu:u,ActionMenu:t}})({editor:n}),{refs:m,floatingStyles:b,context:x}=Pr({placement:"right-start",open:l,onOpenChange:c,middleware:[Un(),Hn(),zn(),En()]}),{isMounted:k,styles:E}=Ur(x,{duration:100}),{setActivatorNodeRef:O,attributes:C,listeners:D}=r,R=Object.assign(Object.assign({},b),E);return t("div",Object.assign({contentEditable:!1,"data-hovered-state-open":a,className:'yoo-editor-flex yoo-editor-absolute -yoo-editor-left-[50px] yoo-editor-top-[2px] yoo-editor-opacity-0 yoo-editor-transition-opacity yoopta-element-actions data-[hovered-state-open="true"]:yoo-editor-opacity-100'},{children:[s&&u&&e(Mr,Object.assign({id:"yoo-block-options-portal",root:document.getElementById("yoopta-editor")},{children:e(Ir,Object.assign({lockScroll:!0,className:"yoo-editor-z-[100]",onClick:y},{children:e("div",Object.assign({style:p,ref:d.setFloating},{children:e(v,Object.assign({},g))}))}))})),e("button",Object.assign({type:"button",onClick:()=>{var e;const t=No(n,{at:[o.meta.order]}),r=n.blocks[o.type];if(!t)return;const i=document.querySelector(`[data-yoopta-block-id="${o.id}"]`),a=ii(r.elements);let l;r.hasCustomEditor||(l=S.string(t,[0]));const c="string"==typeof l&&0===l.trim().length;if(u&&c&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType))n.setSelection([o.meta.order]),n.focusBlock(o.id),d.setReference(i),h(!0);else{const e=Q({id:G()}),t=[o.meta.order+1];n.setSelection([o.meta.order]),n.insertBlock(e,{at:t,focus:!0}),u&&setTimeout((()=>{i&&d.setReference(i.nextSibling),h(!0)}),0)}},className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoo-editor-w-[24px] yoopta-element-actions-plus"},{children:e(Lo,{})})),e("button",Object.assign({type:"button",className:"yoo-editor-cursor-pointer yoo-editor-rounded-[6px] yoo-editor-h-[24px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-center yoo-editor-bg-inherit yoo-editor-bg-transparent yoo-editor-transition-colors yoo-editor-duration-[180ms] yoo-editor-ease-[cubic-bezier(0.4,0,0.2,1)] yoo-editor-relative yoo-editor-w-[18px] yoo-editor-p-0 yoo-editor-text-[rgba(55,53,47,0.35)] yoo-editor-m-[0_1px] hover:yoo-editor-bg-[rgba(55,54,47,0.08)] focus:yoo-editor-bg-[rgba(55,54,47,0.08)] active:yoo-editor-bg-[rgba(55,54,47,0.08)] yoopta-element-actions-drag",ref:e=>{O(e),m.setReference(e)}},C,D,{onClick:e=>{e.stopPropagation(),i(o.id);const t=No(n,{at:[o.meta.order]});n.focusBlock(o.id),t&&setTimeout((()=>{n.blocks[o.type].hasCustomEditor||(w.blur(t),w.deselect(t),_.deselect(t)),n.setBlockSelected([o.meta.order],{only:!0}),n.setSelection([o.meta.order]),c(!0)}),10)}},{children:e(To,{})})),e(pi,{isOpen:k,refs:m,style:R,onClose:()=>c(!1)})]}))},gi=({children:o,block:n,blockId:r})=>{var i;const a=z(),[l,c]=f(null),{attributes:s,listeners:d,setNodeRef:u,setActivatorNodeRef:p,transform:h,transition:y,isOver:g,isDragging:v}=Co({id:r,disabled:a.readOnly}),m={transform:h?`translate3d(${h.x}px, ${h.y}px, 0)`:"none",transition:y,opacity:v?.7:1,marginLeft:20*n.meta.depth+"px"},b=null===(i=a.selectedBlocks)||void 0===i?void 0:i.includes(n.meta.order),w=l===r,x={borderBottom:g&&!v?"2px solid #007aff":"none"};return t("div",Object.assign({ref:u,className:"yoo-editor-relative yoo-editor-py-0 yoo-editor-px-[2px] yoo-editor-mt-[2px] yoo-editor-mb-[1px] yoo-editor-rounded yoopta-block-wrapper",onMouseEnter:()=>{a.readOnly||c(r)},onMouseLeave:()=>{a.readOnly||c(null)},style:m,"data-hovered-block":w,"data-yoopta-block":!0,"data-yoopta-block-id":r},{children:[!a.readOnly&&e(yi,{block:n,editor:a,dragHandleProps:{setActivatorNodeRef:p,attributes:s,listeners:d},showActions:w,onChangeActiveBlock:e=>c(e)}),e("div",Object.assign({style:x},{children:o})),b&&!a.readOnly&&e("div",{className:"yoo-editor-absolute yoo-editor-left-0 yoo-editor-top-0 yoo-editor-bg-[#2383e224] yoo-editor-z-[90] yoo-editor-rounded yoo-editor-opacity-100 yoo-editor-h-full yoo-editor-w-full yoo-editor-pointer-events-none yoopta-selection-block"})]}))};function vi(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;var mi={};Object.defineProperty(mi,"__esModule",{value:!0});for(var bi="undefined"!=typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),wi={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},xi={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:bi?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},ki={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},Ei=1;Ei<20;Ei++)ki["f"+Ei]=111+Ei;function Oi(e,t,o){t&&!("byKey"in t)&&(o=t,t=null),Array.isArray(e)||(e=[e]);var n=e.map((function(e){return Ci(e,t)})),r=function(e){return n.some((function(t){return Si(t,e)}))};return null==o?r:r(o)}function Ci(e,t){var o=t&&t.byKey,n={},r=(e=e.replace("++","+add")).split("+"),i=r.length;for(var a in wi)n[wi[a]]=!1;var l=!0,c=!1,s=void 0;try{for(var d,u=r[Symbol.iterator]();!(l=(d=u.next()).done);l=!0){var f=d.value,p=f.endsWith("?")&&f.length>1;p&&(f=f.slice(0,-1));var h=Di(f),y=wi[h];if(f.length>1&&!y&&!xi[f]&&!ki[h])throw new TypeError('Unknown modifier: "'+f+'"');1!==i&&y||(o?n.key=h:n.which=_i(f)),y&&(n[y]=!p||null)}}catch(e){c=!0,s=e}finally{try{!l&&u.return&&u.return()}finally{if(c)throw s}}return n}function Si(e,t){for(var o in e){var n=e[o],r=void 0;if(null!=n&&((null!=(r="key"===o&&null!=t.key?t.key.toLowerCase():"which"===o?91===n&&93===t.which?91:t.which:t[o])||!1!==n)&&r!==n))return!1}return!0}function _i(e){return e=Di(e),ki[e]||e.toUpperCase().charCodeAt(0)}function Di(e){return e=e.toLowerCase(),e=xi[e]||e}mi.default=Oi,mi.isHotkey=Oi,mi.isCodeHotkey=function(e,t){return Oi(e,t)};var Ri=mi.isKeyHotkey=function(e,t){return Oi(e,{byKey:!0},t)};mi.parseHotkey=Ci,mi.compareHotkey=Si,mi.toKeyCode=_i,mi.toKeyName=Di;const ji={bold:"mod+b",italic:"mod+i",compose:["down","left","right","up","backspace","enter"],arrowLeft:"left",arrowUp:"up",arrowDown:"down",arrowRight:"right",ctrlLeft:"ctrl+left",escape:"esc",ctrlRight:"ctrl+right",deleteBackward:"shift?+backspace",backspace:"backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",shiftEnter:"shift+enter",enter:"enter",space:"space",undo:"mod+z",select:"mod+a",shiftTab:"shift+tab",shiftArrowUp:"shift+up",shiftArrowDown:"shift+down",tab:"tab",cmd:"mod",cmdEnter:"mod+enter",slashCommand:"/",kekCeburek:"mod+enter"},Bi={moveLineBackward:"opt+up",moveLineForward:"opt+down",ctrlLeft:"opt+left",ctrlRight:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Ai={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ti=e=>{const t=ji[e],o=Bi[e],n=Ai[e],r=t&&Ri(t),i=o&&Ri(o),a=n&&Ri(n);return e=>!(!r||!r(e))||(!(!i||!i(e))||!(!a||!a(e)))},Mi={isBold:Ti("bold"),isCompose:Ti("compose"),isArrowLeft:Ti("arrowLeft"),isArrowRight:Ti("arrowRight"),isArrowUp:Ti("arrowUp"),isArrowDown:Ti("arrowDown"),isDeleteBackward:Ti("deleteBackward"),isDeleteForward:Ti("deleteForward"),isDeleteLineBackward:Ti("deleteLineBackward"),isDeleteLineForward:Ti("deleteLineForward"),isDeleteWordBackward:Ti("deleteWordBackward"),isDeleteWordForward:Ti("deleteWordForward"),isExtendBackward:Ti("extendBackward"),isExtendForward:Ti("extendForward"),isExtendLineBackward:Ti("extendLineBackward"),isExtendLineForward:Ti("extendLineForward"),isItalic:Ti("italic"),isMoveLineBackward:Ti("moveLineBackward"),isMoveLineForward:Ti("moveLineForward"),isCtrlLeft:Ti("ctrlLeft"),isCtrlRight:Ti("ctrlRight"),isRedo:Ti("redo"),isShiftEnter:Ti("shiftEnter"),isEnter:Ti("enter"),isTransposeCharacter:Ti("transposeCharacter"),isUndo:Ti("undo"),isSpace:Ti("space"),isSelect:Ti("select"),isTab:Ti("tab"),isShiftTab:Ti("shiftTab"),isBackspace:Ti("backspace"),isCmdEnter:Ti("cmdEnter"),isCmd:Ti("cmd"),isEscape:Ti("escape"),isSlashCommand:Ti("slashCommand"),isShiftArrowUp:Ti("shiftArrowUp"),isShiftArrowDown:Ti("shiftArrowDown"),isKekceburek:Ti("kekCeburek")};const Li={onKeyDown:function(e){return t=>{const o=No(e,{at:e.selection});if(!o||!o.selection)return;const n=D.parent(o.selection.anchor.path);if(Mi.isShiftEnter(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void o.insertText("\n")}if(Mi.isEnter(t)){if(t.isDefaultPrevented())return;t.preventDefault();const r=S.isStart(o,o.selection.anchor,n),i=S.isEnd(o,o.selection.anchor,n);if(!r&&!i)return void e.splitBlock({slate:o,focus:!0});const a=Q({id:G()}),l=e.selection?[e.selection[0]+1]:[0];e.insertBlock(a,{at:l,slate:o,focus:!0})}else if(Mi.isBackspace(t)){if(t.isDefaultPrevented())return;const n=N(e,{at:e.selection});e.blocks[(null==n?void 0:n.type)||""];const r=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,r)){t.preventDefault();const n=S.string(o,r),i=e.selection?e.selection[0]-1:0,a=No(e,{at:[i]}),l=N(e,{at:[i]}),c=e.blocks[(null==l?void 0:l.type)||""];let s;if(a&&!c.hasCustomEditor&&(s=function(e,t){const[,o]=S.last(e,t);return{path:o,offset:S.string(e,o).length}}(a,r)),0===n.trim().length)return e.deleteBlock({at:e.selection,focus:!0,focusAt:s});{if(R.isExpanded(o.selection))return _.delete(o,{at:o.selection});const t=e.selection?e.selection[0]-1:0,n=N(e,{at:[t]});if(e.blocks[(null==n?void 0:n.type)||""].hasCustomEditor)return;if(!a)return;if(0===S.string(a,[0,0]).length)return e.deleteBlock({at:[t],focus:!0,focusAt:s});const r=Array.from(S.nodes(o,{at:[0],match:e=>!S.isEditor(e)&&(j.isText(e)||S.isInline(o,e)),mode:"highest"})).map((([e])=>e));return _.insertNodes(a,r,{at:S.end(a,[])}),e.deleteBlock({at:e.selection,focus:!0,focusAt:s})}}}else{if(Mi.isSelect(t)){if(t.isDefaultPrevented())return;const[,n]=S.first(o,[0]),[,r]=S.last(o,[o.children.length-1]),i=S.range(o,n,r),a=R.equals(o.selection,i);if(R.isExpanded(o.selection)&&a)return t.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),void e.setBlockSelected([],{allSelected:!0})}if(Mi.isShiftTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.decreaseBlockDepth()}if(Mi.isTab(t)){if(t.isDefaultPrevented())return;return t.preventDefault(),void e.increaseBlockDepth()}if(Mi.isArrowUp(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isStart(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]-1]:null,n=No(e,{at:o}),r=N(e,{at:o});if(n&&r){const[,o]=S.last(n,[0]),i={path:o,offset:S.string(n,o).length};return t.preventDefault(),void e.focusBlock(r.id,{focusAt:i,waitExecution:!1,shouldUpdateBlockSelection:!0})}}}if(Mi.isArrowDown(t)){if(t.isDefaultPrevented())return;const n=D.parent(o.selection.anchor.path);if(S.isEnd(o,o.selection.anchor,n)){const o=e.selection?[e.selection[0]+1]:null,r=No(e,{at:o}),i=N(e,{at:o});if(r&&i){const o=function(e,t){const[,o]=S.first(e,t);return{path:o,offset:0}}(r,n);return t.preventDefault(),void e.focusBlock(i.id,{focusAt:o,waitExecution:!1})}}}if(R.isExpanded(o.selection)){if(Object.values(e.formats).length>0)for(const o of Object.values(e.formats))if(o.hotkey&&Ri(o.hotkey)(t)){t.preventDefault(),e.formats[o.type].toggle();break}}}}}},Ni=({children:t,attributes:o,placeholder:n})=>{const r=x(),i=Object.assign({},o);return r&&n&&(i["data-placeholder"]=n,i.className="yoopta-placeholder"),e("span",Object.assign({},i,{children:t}))};function Ii(e){try{return new URL(e),!0}catch(e){return!1}}const Pi=(e,t)=>{(e=>{const[t]=S.nodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type});return!!t})(e)&&(e=>{_.unwrapNodes(e,{match:e=>!S.isEditor(e)&&B.isElement(e)&&"link"===e.type})})(e);const{selection:o}=e,n=o&&R.isCollapsed(o),r={type:"link",children:n?[{text:t}]:[],props:{url:t,target:"_blank",rel:"noreferrer"}};n?_.insertNodes(e,r):(_.wrapNodes(e,r,{split:!0}),_.collapse(e,{edge:"end"}))};function Fi(e){return!!(e&&e.id&&e.type&&e.value&&e.meta)}const zi={B:{type:"bold"},STRONG:{type:"bold"},I:{type:"italic"},U:{type:"underline"},S:{type:"strike"},CODE:{type:"code"},EM:{type:"code"}};function Hi(e,t,o){var n,r,i;if(3===o.nodeType){return null===(n=o.textContent)||void 0===n?void 0:n.replace(/[\t\n\r\f\v]+/g," ")}if(1!==o.nodeType)return null;if("BR"===o.nodeName)return"\n";const a=o;let l=Array.from(a.childNodes).map((o=>Hi(e,t,o))).flat();if(zi[o.nodeName]){return{[zi[o.nodeName].type]:!0,text:null===(r=o.textContent)||void 0===r?void 0:r.replace(/[\t\n\r\f\v]+/g," ")}}if(t[o.nodeName]){const n=t[o.nodeName],r=e.blocks[n.type],a=ri(r.elements)||"",c=r.elements[a],s="void"===(null===(i=c.props)||void 0===i?void 0:i.nodeType);let d={id:G(),type:a,children:s&&!r.hasCustomEditor?[{text:""}]:l.map(Ui),props:Object.assign({nodeType:"block"},c.props)};if(n.parse){const e=n.parse(o);if(e)if(B.isElement(e))d=e;else if(Array.isArray(e)){return e}}0===d.children.length&&(d.children=[{text:""}]);return Q({id:G(),type:n.type,value:[d],meta:{order:0,depth:0}})}return l}function Ui(e){if("string"==typeof e)return{text:e};if(Array.isArray(e))return{text:e[0]};if(e.text)return e;if(Fi(e)){let t="";return e.value[0].children.forEach((e=>{t+=`${e.text}`})),{text:t}}return{text:""}}const Vi={html:{deserialize:function(e,t){console.log("pasted html",t);const o=function(e){const t={};return Object.keys(e.plugins).forEach((o=>{const n=e.plugins[o],{parsers:r}=n;if(r){const{html:e}=r;if(e){const{deserialize:n}=e;if(n){const{nodeNames:e}=n;e&&e.forEach((e=>{t[e]={type:o,parse:n.parse}}))}}}})),t}(e);return Hi(e,o,t).filter(Fi)},serialize:function(){}},markdown:{}},Ki=({id:t,customEditor:o,elements:n,marks:r,events:i,options:a,placeholder:c="Type '/' for commands"})=>{var s,f,p;const h=z(),y=H(t),g=l(y.value).current,v=y.type,m=d((()=>(e=>{const t={};return Object.keys(e).forEach((o=>t[o]=e[o].render)),t})(n)),[n]),b=d((()=>(e=>{const t={};return e?(e.forEach((e=>t[e.type]=e)),t):t})(r)),[r]),w=d((()=>{let e=h.blockEditorsMap[t];return Object.keys(n).forEach((t=>{var o;const r=null===(o=n[t].props)||void 0===o?void 0:o.nodeType,i="inline"===r,a="void"===r,l="inlineVoid"===r;l&&(e.markableVoid=e=>e.type===t),(a||l)&&(e.isVoid=e=>e.type===t),(i||l)&&(e.isInline=e=>e.type===t,e=(e=>{const{insertData:t,insertText:o}=e;return e.insertText=t=>{t&&Ii(t)?Pi(e,t):o(t)},e.insertData=o=>{const n=o.getData("text/plain");n&&Ii(n)?Pi(e,n):t(o)},e})(e))})),e}),[]),x=d((()=>{if(!i||h.readOnly)return{};const e={hotkeys:Mi,currentBlock:y,defaultBlock:Q({id:G()})},t={};return Object.keys(i).forEach((o=>{t[o]=function(t){if(i[o]){i[o](h,w,e)(t)}}})),t}),[i,h,y]),k=u((e=>h.updateBlock(t,{value:e})),[t]),E=u((o=>{const n=m[o.element.type];return n?e(n,Object.assign({},o,{blockId:t,HTMLAttributes:null==a?void 0:a.HTMLAttributes})):e(O,Object.assign({},o))}),[n]),C=u((t=>{var o,n,r,i,a;let{children:l,leaf:s,attributes:d}=t;const u=vi(s,["text"]),f=(null===(o=h.selection)||void 0===o?void 0:o[0])===y.meta.order;u&&Object.keys(u).forEach((e=>{const t=b[e];t&&(l=t.render({children:l,leaf:s}))}));const p=!("void"===(null===(a=null===(i=null===(r=null===(n=t.children)||void 0===n?void 0:n.props)||void 0===r?void 0:r.parent)||void 0===i?void 0:i.props)||void 0===a?void 0:a.nodeType))&&f&&s.withPlaceholder;return e(Ni,Object.assign({attributes:d,placeholder:p?c:void 0},{children:l}))}),[r]),_=u((e=>{var t;h.readOnly||(null===(t=x.onKeyDown)||void 0===t||t.call(x,e),Li.onKeyDown(h)(e))}),[x.onKeyDown,h.readOnly,null===(s=h.selection)||void 0===s?void 0:s[0],y.meta.order]),D=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onKeyUp)||void 0===t||t.call(x,e)}),[x.onKeyUp,h.readOnly]),j=u((e=>{var t,o;h.readOnly||((null===(t=h.selection)||void 0===t?void 0:t[0])!==y.meta.order&&h.setSelection([y.meta.order]),null===(o=null==x?void 0:x.onClick)||void 0===o||o.call(x,e))}),[x.onClick,h.readOnly,null===(f=h.selection)||void 0===f?void 0:f[0],y.meta.order]),B=u((e=>{var t;h.readOnly||(e.preventDefault(),null===(t=null==x?void 0:x.onBlur)||void 0===t||t.call(x,e))}),[x.onBlur,h.readOnly]),A=u((e=>{var t;h.readOnly||null===(t=null==x?void 0:x.onFocus)||void 0===t||t.call(x,e)}),[x.onFocus,h.readOnly]),T=u((e=>{var t;if(h.readOnly)return;null===(t=null==x?void 0:x.onPaste)||void 0===t||t.call(x,e);const o=e.clipboardData.getData("text/html"),n=(new DOMParser).parseFromString(o,"text/html");if(n.body.childNodes.length>0){const e=Vi.html.deserialize(h,n.body);if(e.length>0)return void h.insertBlocks(e,{at:h.selection,focus:!0})}}),[x.onPaste,h.readOnly]),M=u((e=>{var t;const o=[];if(h.readOnly)return o;const[n,r]=e,i=(null===(t=h.selection)||void 0===t?void 0:t[0])===y.meta.order;return w.selection&&i&&!S.isEditor(n)&&""===S.string(w,[r[0]])&&R.includes(w.selection,r)&&R.isCollapsed(w.selection)&&o.push(Object.assign(Object.assign({},w.selection),{withPlaceholder:!0})),o}),[h.readOnly,null===(p=h.selection)||void 0===p?void 0:p[0],y.meta.order]);return e("div",Object.assign({"data-plugin-id":t,"data-plugin-type":v},{children:e(Wi,{id:t,slate:w,initialValue:g,onChange:k,decorate:M,renderLeaf:C,renderElement:E,eventHandlers:x,onKeyDown:_,onKeyUp:D,onFocus:A,onClick:j,onBlur:B,customEditor:o,readOnly:h.readOnly,onPaste:T})}))},Wi=p((({id:t,slate:o,initialValue:n,onChange:r,renderLeaf:i,renderElement:a,eventHandlers:l,onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,onBlur:f,onPaste:p,customEditor:h,decorate:y,readOnly:g})=>"function"==typeof h?h({blockId:t}):e(k,Object.assign({editor:o,initialValue:n,onChange:r},{children:e(E,Object.assign({id:`yoopta-slate-editor-${t}`,renderElement:a,renderLeaf:i,className:"focus-visible:yoo-editor-outline-none focus:yoo-editor-outline-none",spellCheck:!0},l,{onKeyDown:c,onKeyUp:s,onFocus:d,onClick:u,decorate:y,onBlur:f,readOnly:g,onPaste:p}),`editable-${t}`)}),`slate-${t}`)));Wi.displayName="SlateEditorInstance";const Yi=({editor:e})=>({sensors:function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return d((()=>[...t].filter((e=>null!=e))),[...t])}(Te(Ot,{activationConstraint:{delay:100,tolerance:0}}),Te(bt,{coordinateGetter:Do})),handleDragEnd:u((t=>{const{active:o,over:n}=t;if(o&&n&&o.id!==n.id){const t=e.children[n.id].meta.order;e.moveBlock(o.id,[t])}}),[]),handleDragStart:u((t=>{e.setBlockSelected(null)}),[])}),$i=[],Xi=({editor:t,marks:n,placeholder:r})=>{const i=K(),{sensors:a,handleDragEnd:l,handleDragStart:c}=Yi({editor:t}),s=Object.keys(t.children),u=d((()=>0===s.length?$i:s.sort(((e,o)=>t.children[e].meta.order-t.children[o].meta.order))),[s]),f=[];for(let o=0;o<u.length;o++){const i=u[o],a=t.children[i],l=t.plugins[a.type];a&&l?f.push(e(gi,Object.assign({block:a,blockId:i},{children:e(Ki,{type:a.type,id:i,marks:n,customEditor:l.customEditor,events:l.events,elements:l.elements,options:l.options,placeholder:r},i)}),i)):console.error(`Plugin ${a.type} not found`)}return i?e(o,{children:f}):e(oo,Object.assign({sensors:a,collisionDetection:He,onDragStart:c,onDragEnd:l},{children:e(mo,Object.assign({disabled:i,items:u,strategy:yo},{children:f}))}))},Zi=({editor:e,yooptaEditorRef:t,root:o})=>{const[n,r]=f({origin:[0,0],coords:[0,0],selection:!1}),i=i=>{var a;if(e.readOnly||!1===o)return;const l=null===(a=t.current)||void 0===a?void 0:a.contains(i.target);if(!l&&!n.selection&&Array.isArray(e.selectedBlocks)&&e.selectedBlocks.length>0)return e.setBlockSelected(null),c();l||r({origin:[i.pageX,i.pageY-window.pageYOffset],coords:[i.pageX,i.pageY-window.pageYOffset],selection:!0})},a=t=>{if(!n.selection||e.readOnly||!1===o)return;r((e=>Object.assign(Object.assign({},e),{coords:[t.pageX,t.pageY-window.pageYOffset]})));const i=((e,t)=>{const o=[];return document.querySelectorAll("[data-yoopta-block]").forEach(((n,r)=>{if(!n)return;const i=n.getBoundingClientRect(),a=Math.min(e[1],t[1]),l=Math.min(e[0],t[0]),c=Math.max(e[1],t[1]),s=Math.max(e[0],t[0]);a<i.bottom&&c>i.top&&l<i.right&&s>i.left&&o.push(r)})),o})(n.origin,[t.pageX,t.pageY-window.pageYOffset]);e.setBlockSelected(i,{only:!0})},l=()=>{e.readOnly||c()};s((()=>{var n;if(e.readOnly||!1===o)return;const r=o&&"current"in o?o.current:o||document;if(!r)throw new Error("Root element not found. Please check the `selectionBoxRoot` prop");if(!("nodeType"in r))throw new Error("Root element should be a DOM element or a ref object. Please check the `selectionBoxRoot` prop");if(null===(n=t.current)||void 0===n?void 0:n.contains(r))throw new Error("Root element should not be a child of the editor. Please check the `selectionBoxRoot` prop");return r.addEventListener("mousedown",i),r.addEventListener("mousemove",a),r.addEventListener("mouseup",l),()=>{r.removeEventListener("mousedown",i),r.removeEventListener("mousemove",a),r.removeEventListener("mouseup",l)}}),[e.selectedBlocks,n,o,e.readOnly]);const c=()=>{r({origin:[0,0],coords:[0,0],selection:!1})};return Object.assign(Object.assign({},n),{onClose:c})},qi=({origin:t,coords:o,isOpen:n})=>{if(!n)return null;const r={zIndex:10,left:t[0],top:t[1],height:Math.abs(o[1]-t[1]-1),width:Math.abs(o[0]-t[0]-1),userSelect:"none",transformOrigin:"top left",transform:t[1]>o[1]&&t[0]>o[0]?"scaleY(-1) scaleX(-1)":t[1]>o[1]?"scaleY(-1)":t[0]>o[0]?"scaleX(-1)":void 0,position:"fixed",backgroundColor:"rgba(35, 131, 226, 0.14)"};return e("div",{style:r})},Gi={selectionStarted:!1,indexToSelect:null,startedIndexToSelect:null},Ji=({placeholder:o,marks:n,className:r,selectionBoxRoot:i,width:a,autoFocus:c=!0})=>{const d=z(),u=K(),f=l(null),p=Zi({editor:d,yooptaEditorRef:f,root:i});let h=l(Gi).current;s((()=>{if(!c||u)return;const e=N(d,{at:[0]});e&&d.focusBlock(e.id,{waitExecution:!0})}),[c,u]),s((()=>{if(!u)return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)}),[d.selectedBlocks,u]);const y=()=>{u||Array.isArray(d.selectedBlocks)&&d.selectedBlocks.length>0&&d.setBlockSelected(null)},g=()=>{h.indexToSelect=null,h.startedIndexToSelect=null,h.selectionStarted=!1},v=e=>{var t,o,n,r,i;if(!u){if(Mi.isSelect(e)){if((null===(t=d.selectedBlocks)||void 0===t?void 0:t.length)===Object.keys(d.children).length)return void e.preventDefault();if(h.selectionStarted)return e.preventDefault(),void d.setBlockSelected([],{allSelected:!0})}if(Mi.isBackspace(e)){e.stopPropagation();if(Array.isArray(d.selectedBlocks)&&(null===(o=d.selectedBlocks)||void 0===o?void 0:o.length)===Object.keys(d.children).length)return e.preventDefault(),d.deleteBlock({deleteAll:!0}),d.setBlockSelected(null),void g();if(Array.isArray(d.selectedBlocks)&&(null===(n=d.selectedBlocks)||void 0===n?void 0:n.length)>0)return e.preventDefault(),d.deleteBlock({fromPaths:d.selectedBlocks}),d.setBlockSelected(null),void g()}if(Mi.isShiftArrowUp(e)){if("function"==typeof e.isDefaultPrevented&&e.isDefaultPrevented())return;if(h.selectionStarted&&null!==h.startedIndexToSelect&&null!==h.indexToSelect){const e=h.indexToSelect,t=e-1;if(0===e)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t<h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(r=d.selectedBlocks)||void 0===r?void 0:r.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),i=S.isStart(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&i){const n=d.selection?[d.selection[0]-1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,t.meta.order-1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order-1,h.selectionStarted=!0)}}if(Mi.isShiftArrowDown(e)){if(h.selectionStarted&&null!==h.indexToSelect&&null!==h.startedIndexToSelect){const e=h.indexToSelect,t=e+1;if(t===Object.keys(d.children).length)return;if(e===h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if(t>h.startedIndexToSelect)return d.setBlockSelected([t]),void(h.indexToSelect=t);if((null===(i=d.selectedBlocks)||void 0===i?void 0:i.includes(e))&&e!==h.startedIndexToSelect){const o=d.selectedBlocks.filter((t=>t!==e));return d.setBlockSelected(o,{only:!0}),void(h.indexToSelect=t)}return}const t=N(d),o=No(d);if(!o||!o.selection||!t)return;const n=D.parent(o.selection.anchor.path),r=S.isEnd(o,o.selection.focus,n);if(R.isExpanded(o.selection)&&r){const n=d.selection?[d.selection[0]+1]:[0],r=N(d,{at:n});t&&r&&(e.preventDefault(),w.blur(o),w.deselect(o),_.deselect(o),d.setSelection(null),d.setBlockSelected([null==t?void 0:t.meta.order,(null==t?void 0:t.meta.order)+1]),h.startedIndexToSelect=t.meta.order,h.indexToSelect=t.meta.order+1,h.selectionStarted=!0)}}}},m=(b={userSelect:p.selection?"none":"auto",pointerEvents:p.selection?"none":"auto",width:a},Object.assign({paddingBottom:150},b));var b;return t("div",Object.assign({id:"yoopta-editor",className:r,style:m,ref:f,onClick:e=>{u||(g(),(e=>{var t;const o=f.current;if(!o)return;const{bottom:n}=o.getBoundingClientRect(),r=n-parseInt(getComputedStyle(o).paddingBottom,10),i=Q({id:G()});if(e.clientY>=r){const e=Object.keys(d.children).length-1,o=N(d,{at:[e]}),n=No(d,{at:[e]});if(o&&n&&n.selection){const e=S.string(n,n.selection.anchor.path),r=D.parent(n.selection.anchor.path),[a]=S.node(n,r);if(o.type===i.type&&B.isElement(a)&&"void"!==(null===(t=a.props)||void 0===t?void 0:t.nodeType)&&0===e.trim().length)return void d.focusBlock(o.id,{slate:n})}const r=e+1;d.insertBlock(i,{at:[r],focus:!0})}})(e),y())},onBlur:e=>{var t;(null===(t=f.current)||void 0===t?void 0:t.contains(e.relatedTarget))||u||(g(),y())}},{children:[e(Xi,{editor:d,marks:n,placeholder:o}),!1!==i&&e(qi,{origin:p.origin,coords:p.coords,isOpen:p.selection&&!u})]}))},Qi=({children:e,fallback:t=null})=>{const[o,n]=f(!1);return s((()=>n(!0)),[]),o?e:t};
7
7
  /*!
8
8
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
9
9
  *
10
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
12
  */
13
- function ea(e){return"[object Object]"===Object.prototype.toString.call(e)}var ta={isHistory(e){return!1!==ea(t=e)&&(void 0===(o=t.constructor)||!1!==ea(n=o.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,o,n}},oa=new WeakMap,na=new WeakMap,ra={isHistoryEditor:e=>ta.isHistory(e.history)&&S.isEditor(e),isMerging:e=>na.get(e),isSaving:e=>oa.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var o=ra.isMerging(e);na.set(e,!1),t(),na.set(e,o)},withoutSaving(e,t){var o=ra.isSaving(e);oa.set(e,!1),t(),oa.set(e,o)}},ia=e=>{var t=e,{apply:o}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:o}=e;if(o.length>0){var n=o[o.length-1];n.selectionBefore&&_.setSelection(t,n.selectionBefore),ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of n.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",n)}},t.undo=()=>{var{history:e}=t,{undos:o}=e;if(o.length>0){var n=o[o.length-1];ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=n.operations.map(A.inverse).reverse();for(var o of e)t.apply(o);n.selectionBefore&&_.setSelection(t,n.selectionBefore)}))})),t.writeHistory("redos",n),e.undos.pop()}},t.apply=e=>{var{operations:n,history:r}=t,{undos:i}=r,a=i[i.length-1],l=a&&a.operations[a.operations.length-1],c=ra.isSaving(t),s=ra.isMerging(t);if(null==c&&(c=la(e)),c){if(null==s&&(s=null!=a&&(0!==n.length||aa(e,l))),a&&s)a.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();r.redos=[]}o(e)},t.writeHistory=(e,o)=>{t.history[e].push(o)},t},aa=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!D.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!D.equals(e.path,t.path)),la=(e,t)=>"set_selection"!==e.type,ca=Symbol.for("immer-nothing"),sa=Symbol.for("immer-draftable"),da=Symbol.for("immer-state");function ua(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fa=Object.getPrototypeOf;function pa(e){return!!e&&!!e[da]}function ha(e){return!!e&&(ga(e)||Array.isArray(e)||!!e[sa]||!!e.constructor?.[sa]||xa(e)||ka(e))}var ya=Object.prototype.constructor.toString();function ga(e){if(!e||"object"!=typeof e)return!1;const t=fa(e);if(null===t)return!0;const o=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return o===Object||"function"==typeof o&&Function.toString.call(o)===ya}function va(e,t){0===ma(e)?Reflect.ownKeys(e).forEach((o=>{t(o,e[o],e)})):e.forEach(((o,n)=>t(n,o,e)))}function ma(e){const t=e[da];return t?t.type_:Array.isArray(e)?1:xa(e)?2:ka(e)?3:0}function ba(e,t){return 2===ma(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wa(e,t,o){const n=ma(e);2===n?e.set(t,o):3===n?e.add(o):e[t]=o}function xa(e){return e instanceof Map}function ka(e){return e instanceof Set}function Oa(e){return e.copy_||e.base_}function Ea(e,t){if(xa(e))return new Map(e);if(ka(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ga(e)){if(!fa(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const o=Object.getOwnPropertyDescriptors(e);delete o[da];let n=Reflect.ownKeys(o);for(let t=0;t<n.length;t++){const r=n[t],i=o[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(fa(e),o)}function Ca(e,t=!1){return _a(e)||pa(e)||!ha(e)||(ma(e)>1&&(e.set=e.add=e.clear=e.delete=Sa),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Ca(t,!0)))),e}function Sa(){ua(2)}function _a(e){return Object.isFrozen(e)}var Da,Ra={};function ja(e){const t=Ra[e];return t||ua(0),t}function Ba(){return Da}function Aa(e,t){t&&(ja("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ta(e){Ma(e),e.drafts_.forEach(Na),e.drafts_=null}function Ma(e){e===Da&&(Da=e.parent_)}function La(e){return Da={drafts_:[],parent_:Da,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Na(e){const t=e[da];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ia(e,t){t.unfinalizedDrafts_=t.drafts_.length;const o=t.drafts_[0];return void 0!==e&&e!==o?(o[da].modified_&&(Ta(t),ua(4)),ha(e)&&(e=Pa(t,e),t.parent_||za(t,e)),t.patches_&&ja("Patches").generateReplacementPatches_(o[da].base_,e,t.patches_,t.inversePatches_)):e=Pa(t,o,[]),Ta(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ca?e:void 0}function Pa(e,t,o){if(_a(t))return t;const n=t[da];if(!n)return va(t,((r,i)=>Fa(e,n,t,r,i,o))),t;if(n.scope_!==e)return t;if(!n.modified_)return za(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let r=t,i=!1;3===n.type_&&(r=new Set(t),t.clear(),i=!0),va(r,((r,a)=>Fa(e,n,t,r,a,o,i))),za(e,t,!1),o&&e.patches_&&ja("Patches").generatePatches_(n,o,e.patches_,e.inversePatches_)}return n.copy_}function Fa(e,t,o,n,r,i,a){if(pa(r)){const a=Pa(e,r,i&&t&&3!==t.type_&&!ba(t.assigned_,n)?i.concat(n):void 0);if(wa(o,n,a),!pa(a))return;e.canAutoFreeze_=!1}else a&&o.add(r);if(ha(r)&&!_a(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Pa(e,r),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(o,n)||za(e,r)}}function za(e,t,o=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ca(t,o)}var Ha={get(e,t){if(t===da)return e;const o=Oa(e);if(!ba(o,t))return function(e,t,o){const n=Ka(t,o);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,o,t);const n=o[t];return e.finalized_||!ha(n)?n:n===Va(e.base_,t)?(Ya(e),e.copy_[t]=$a(n,e)):n},has:(e,t)=>t in Oa(e),ownKeys:e=>Reflect.ownKeys(Oa(e)),set(e,t,o){const n=Ka(Oa(e),t);if(n?.set)return n.set.call(e.draft_,o),!0;if(!e.modified_){const n=Va(Oa(e),t),a=n?.[da];if(a&&a.base_===o)return e.copy_[t]=o,e.assigned_[t]=!1,!0;if(((r=o)===(i=n)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==o||ba(e.base_,t)))return!0;Ya(e),Wa(e)}var r,i;return e.copy_[t]===o&&(void 0!==o||t in e.copy_)||Number.isNaN(o)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=o,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Va(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ya(e),Wa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const o=Oa(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty(){ua(11)},getPrototypeOf:e=>fa(e.base_),setPrototypeOf(){ua(12)}},Ua={};function Va(e,t){const o=e[da];return(o?Oa(o):e)[t]}function Ka(e,t){if(!(t in e))return;let o=fa(e);for(;o;){const e=Object.getOwnPropertyDescriptor(o,t);if(e)return e;o=fa(o)}}function Wa(e){e.modified_||(e.modified_=!0,e.parent_&&Wa(e.parent_))}function Ya(e){e.copy_||(e.copy_=Ea(e.base_,e.scope_.immer_.useStrictShallowCopy_))}va(Ha,((e,t)=>{Ua[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ua.deleteProperty=function(e,t){return Ua.set.call(this,e,t,void 0)},Ua.set=function(e,t,o){return Ha.set.call(this,e[0],t,o,e[0])};function $a(e,t){const o=xa(e)?ja("MapSet").proxyMap_(e,t):ka(e)?ja("MapSet").proxySet_(e,t):function(e,t){const o=Array.isArray(e),n={type_:o?1:0,scope_:t?t.scope_:Ba(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=n,i=Ha;o&&(r=[n],i=Ua);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return n.draft_=l,n.revoke_=a,l}(e,t);return(t?t.scope_:Ba()).drafts_.push(o),o}function Xa(e){if(!ha(e)||_a(e))return e;const t=e[da];let o;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,o=Ea(e,t.scope_.immer_.useStrictShallowCopy_)}else o=Ea(e,!0);return va(o,((e,t)=>{wa(o,e,Xa(t))})),t&&(t.finalized_=!1),o}var Za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,o)=>{if("function"==typeof e&&"function"!=typeof t){const o=t;t=e;const n=this;return function(e=o,...r){return n.produce(e,(e=>t.call(this,e,...r)))}}let n;if("function"!=typeof t&&ua(6),void 0!==o&&"function"!=typeof o&&ua(7),ha(e)){const r=La(this),i=$a(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Ta(r):Ma(r)}return Aa(r,o),Ia(n,r)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===ca&&(n=void 0),this.autoFreeze_&&Ca(n,!0),o){const t=[],r=[];ja("Patches").generateReplacementPatches_(e,n,t,r),o(t,r)}return n}ua(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...o)=>this.produceWithPatches(t,(t=>e(t,...o)));let o,n;return[this.produce(e,t,((e,t)=>{o=e,n=t})),o,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ha(e)||ua(8),pa(e)&&(e=function(e){pa(e)||ua(10);return Xa(e)}(e));const t=La(this),o=$a(e,void 0);return o[da].isManual_=!0,Ma(t),o}finishDraft(e,t){const o=e&&e[da];o&&o.isManual_||ua(9);const{scope_:n}=o;return Aa(n,t),Ia(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let o;for(o=t.length-1;o>=0;o--){const n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));const n=ja("Patches").applyPatches_;return pa(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};Za.produce,Za.produceWithPatches.bind(Za),Za.setAutoFreeze.bind(Za),Za.setUseStrictShallowCopy.bind(Za),Za.applyPatches.bind(Za);var qa=Za.createDraft.bind(Za),Ga=Za.finishDraft.bind(Za);function Ja(e,t){const o=No(e);if(!o)return!1;const n=S.marks(o);return!!(null==n?void 0:n[t])}const Qa=(e,t)=>{const{insertText:o}=t;return t.insertText=n=>{var r;const{selection:i}=t;if(" "===n&&i&&R.isCollapsed(i)){const{anchor:a}=i,l=S.above(t,{match:e=>B.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=S.parent(t,c),[d]=s;if(B.isElement(d)&&!j.isText(d.children[0]))return o(n);const u=l?c:[],f={anchor:a,focus:S.start(t,u)},p=S.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return _.select(t,f),_.delete(t),void h.create({deleteText:!1})}o(n)},t};function el(e,t,o){e.children=qa(e.children);let n=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);o.id&&(r.id=o.id,n=!0),o.type&&(r.type=o.type,n=!0),o.meta&&(r.meta=o.meta,n=!0),o.value&&(r.value=o.value),e.children=Ga(e.children),n&&e.applyChanges(),e.emit("change",e.children)}const tl="Paragraph";function ol(e,t,o){e.children=qa(e.children);const n=N(e,{at:(null==o?void 0:o.at)||e.selection});if(!n)throw new Error("Block from not found at current selection");let r=t;n.type===r&&(r=tl);const i=No(e,{at:[n.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${n.meta.order}`);const a=ri(e.blocks[r].elements);S.withoutNormalizing(i,(()=>{_.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>B.isElement(e)&&!S.isInline(i,e)}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const t={id:n.id,type:r,meta:Object.assign(Object.assign({},n.meta),{order:n.meta.order}),value:i.children};e.blockEditorsMap[n.id]=i,e.children[n.id]=t,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(t.id,{slate:i})}))}function nl(e,t={}){const{at:o=e.selection,deleteAll:n=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=qa(e.children),r.forEach((t=>{const o=N(e,{at:[t]});o&&(delete e.children[o.id],delete e.blockEditorsMap[o.id])}));return Object.keys(e.children).forEach(((t,o)=>{e.children[t].meta.order=o})),e.children=Ga(e.children),e.applyChanges(),void e.emit("change",e.children)}if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=Q({id:G()}),o=al(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=o,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:o,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!o)return;e.children=qa(e.children);const[a]=o,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const o=e.children[t];o.meta.order>a&&(o.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),i){const o=e.selection?e.selection[0]-1:0,n=N(e,{at:[o]});n&&e.focusBlock(n.id,{focusAt:t.focusAt})}}function rl(e,t){const o={};return t.forEach((t=>{const n=t.type;o[n]={hotkey:t.hotkey,type:n,getValue:()=>function(e,t){const o=No(e);if(!o)return null;const n=S.marks(o);return null==n?void 0:n[t]}(e,n),isActive:()=>Ja(e,n),toggle:()=>function(e,t){const o=No(e),n=Ja(e,t);o&&(n?S.removeMark(o,t):S.addMark(o,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,n),update:t=>function(e,t,o){const n=No(e);n&&n.selection&&R.isExpanded(n.selection)&&(S.addMark(n,t,o),e.applyChanges(),e.emit("change",e.children))}(e,n,t)}})),o}function il(e,t){const o={};return t.forEach(((t,n)=>{var r;const i=ii(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const n={};Object.keys(t.elements).forEach((e=>{const o=vi(t.elements[e],["render"]);n[e]=o}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};o[t.type]={type:t.type,elements:n,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const o=N(e,{at:e.selection});return(null==o?void 0:o.type)===t.type},toggle:o=>{ol(e,t.type,o)},create:o=>{!function(e,t,o){var n;e.children=qa(e.children);const r=N(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==o?void 0:o.slate)||No(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=ri(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(n=c.props)||void 0===n?void 0:n.nodeType)||"block"},c.props),d=J({id:G(),type:l,props:s});_.setNodes(i,d,{at:[0,0],match:e=>B.isElement(e),mode:"highest"}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const u=Q({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,o)},update:(t,o)=>{el(e,t,o)},updateElement:(t,o,n)=>{!function(e,t,o,n){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=No(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:[0],match:e=>B.isElement(e)&&e.type===o}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),n)};_.setNodes(i,l,{at:[0],match:e=>B.isElement(e)&&e.type===o,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,o,n)},delete:t=>{nl(e,t)}}}})),o}function al(e){return Qa(e,ia(C(T())))}function ll({type:e,hotkey:t,render:o}){return{type:e,hotkey:t,render:o}}const cl=ll({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),sl=(()=>{const e=G();return{[e]:Q({id:e})}})(),dl=new Z,ul=(e,t)=>dl.on(e,t),fl=(e,t)=>dl.once(e,t),pl=(e,t)=>dl.off(e,t),hl=(e,t)=>dl.emit(e,t);const yl=({editor:o,value:n,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:y})=>{const g=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[cl,...r]:[cl]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>{o.applyChanges=g,o.readOnly=h||!1,v&&(o.formats=rl(o,v)),o.blocks=il(o,m);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(n);return e||void 0===n||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(n)}`),o.children=e?n:sl,o.blockEditorsMap=function(e){const t={};return Object.keys(e.children).forEach((o=>{const n=al(e);t[o]=n})),t}(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var o,n,r,i;e.options&&Array.isArray(null===(o=e.options)||void 0===o?void 0:o.shortcuts)&&(null===(n=e.options)||void 0===n?void 0:n.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((o=>{t[o]=e})))})),t}(o),o.plugins=function(e){const t={},o={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var n;const r=e.elements[t],i=null===(n=r.props)||void 0===n?void 0:n.nodeType;"inline"!==i&&"inlineVoid"!==i||(o[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const n=Object.assign(Object.assign({},e.elements),o);t[e.type]=Object.assign(Object.assign({},e),{elements:n})}})),t}(m),o.on=ul,o.once=fl,o.off=pl,o.emit=hl,{editor:o,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(n)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(Qi,{children:e(F,Object.assign({editorState:b},{children:t(li,Object.assign({tools:c},{children:[e(Ji,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:y}),u]}))}))})},gl=Object.assign(Object.assign({},hi),{ExtendedBlockActions:({id:n,className:r,style:i,onClick:a,children:l})=>{const c=K(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Pr({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Un(),Hn(),zn(),On(10)],whileElementsMounted:Fn}),{isMounted:y,styles:g}=Ur(h,{duration:100}),v=Object.assign(Object.assign({},g),p);return c?null:t(o,{children:[y&&e(pi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:v},{children:l})),e("button",Object.assign({type:"button",ref:u.setReference,id:n,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${r||""} yoopta-extended-block-actions`,onClick:()=>{null==a||a(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qr,{})}))]})}});function vl(e,t){const o=Object.keys(e.children),{type:n}=t||{},r=o.find((t=>e.children[t].type===n));return r?e.children[r]:null}function ml(e,t,o={}){try{const{focusAt:n,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=o,l=()=>{const r=o.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(M.isPoint(t))return t;if(D.isPath(t))return{path:t,offset:0};const[,o]=S.first(e,[0]);return{path:o||[0,0],offset:0}}(r,n);_.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function bl(e){return Array.from(new Set(e))}var wl={};!function(e,t){var o="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",y="[object String]",g="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",_="[object Uint16Array]",D="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[O]=A[E]=A[s]=A[d]=A[u]=A[p]=A[h]=A[y]=A[g]=A[C]=A[S]=A[_]=A[D]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof $&&$&&$.Object===Object&&$,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function F(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function H(e,t,o,n){var r=-1,i=e?e.length:0;for(n&&i&&(o=e[++r]);++r<i;)o=t(o,e[r],r,e);return o}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,o=Array(e.size);return e.forEach((function(e,n){o[++t]=[n,e]})),o}function K(e,t){return function(o){return e(t(o))}}function W(e){var t=-1,o=Array(e.size);return e.forEach((function(e){o[++t]=e})),o}var Y,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,oe=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ye=Pe(L,"Promise"),ge=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ye),ke=Ve(ge),Oe=Ve(ve),Ee=re?re.prototype:void 0,Ce=Ee?Ee.valueOf:void 0;function Se(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function _e(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function De(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Re(e){this.__data__=new _e(e)}function je(e,t){var o=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}(e.length,String):[],n=o.length,i=!!n;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||He(a,n))||o.push(a);return o}function Be(e,t,o){var n=e[t];ee.call(e,t)&&Ke(n,o)&&(void 0!==o||t in e)||(e[t]=o)}function Ae(e,t){for(var o=e.length;o--;)if(Ke(e[o][0],t))return o;return-1}function Te(e,t,o,n,f,v,j){var B;if(n&&(B=v?n(e,f,v,j):n(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,o=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(o.index=e.index,o.input=e.input);return o}(e),!t)return function(e,t){var o=-1,n=e.length;t||(t=Array(n));for(;++o<n;)t[o]=e[o];return t}(e,B)}else{var M=ze(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}(e,t);if(M==u||M==r||L&&!v){if(U(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,Fe(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,o,n){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}(e,n);case w:case x:case k:case O:case E:case C:case S:case _:case D:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,n);case s:return function(e,t,o){var n=t?o(V(e),!0):V(e);return H(n,F,new e.constructor)}(e,n,o);case d:case y:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,o){var n=t?o(W(e),!0):W(e);return H(n,z,new e.constructor)}(e,n,o);case g:return l=e,Ce?Object(Ce.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=o?function(e){return function(e,t,o){var n=t(e);return We(e)?n:function(e,t){for(var o=-1,n=t.length,r=e.length;++o<n;)e[r+o]=t[o];return e}(n,o(e))}(e,qe,Fe)}(e):qe(e);return function(e,t){for(var o=-1,n=e?e.length:0;++o<n&&!1!==t(e[o],o,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,o,n,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?oe:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,o,n){o||(o={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=n?n(o[a],e[a],a,o,e):void 0;Be(o,a,void 0===l?e[a]:l)}return o}function Ie(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(o)?o:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===o?void 0:n}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?o:t,this},_e.prototype.clear=function(){this.__data__=[]},_e.prototype.delete=function(e){var t=this.__data__,o=Ae(t,e);return!(o<0)&&(o==t.length-1?t.pop():se.call(t,o,1),!0)},_e.prototype.get=function(e){var t=this.__data__,o=Ae(t,e);return o<0?void 0:t[o][1]},_e.prototype.has=function(e){return Ae(this.__data__,e)>-1},_e.prototype.set=function(e,t){var o=this.__data__,n=Ae(o,e);return n<0?o.push([e,t]):o[n][1]=t,this},De.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||_e),string:new Se}},De.prototype.delete=function(e){return Ie(this,e).delete(e)},De.prototype.get=function(e){return Ie(this,e).get(e)},De.prototype.has=function(e){return Ie(this,e).has(e)},De.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new _e},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var o=this.__data__;if(o instanceof _e){var n=o.__data__;if(!he||n.length<199)return n.push([e,t]),this;o=this.__data__=new De(n)}return o.set(e,t),this};var Fe=de?K(de,Object):function(){return[]},ze=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=s||ye&&ze(ye.resolve())!=f||ge&&ze(new ge)!=h||ve&&ze(new ve)!=v)&&(ze=function(e){var t=te.call(e),o=t==u?e.constructor:void 0,n=o?Ve(o):void 0;if(n)switch(n){case be:return b;case we:return s;case xe:return f;case ke:return h;case Oe:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!Ue(e))return fe(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return wl},set exports(e){wl=e}},wl);var xl=wl;function kl(e,t={}){const{blockId:o,focus:n}=t;if(!o&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(o&&(r=e.children[o],!r))throw new Error(`Block not with blockId: ${o} found`);if(t.at&&(r=N(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=qa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):xl(a));var a;const l=al(e);i.id=G(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(c,{waitExecution:!0})}function Ol(e,t){w.blur(t),w.deselect(t),_.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const El=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n=null,focus:r=!1,slate:i=null}=o,a=N(e),l=n,c={id:G(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=al(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n,focus:r}=o;let i=n||[0];const a=N(e),l=No(e);let c=!1,s=!1;if(l&&l.selection){const t=D.parent(l.selection.anchor.path),o=S.string(l,t).trim(),n=S.isStart(l,l.selection.anchor,t);c=""===o&&n,s=!n||o.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,o)=>{const n={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+o})};d.push(n.meta.order),e.children[n.id]=n;const r=al(e);e.blockEditorsMap[n.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((o=>{const n=e.children[o];n.meta.order>t&&(n.meta.order-=1)}))}e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>nl(e,...t),duplicateBlock:(...t)=>kl(e,...t),toggleBlock:(...t)=>ol(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=n.meta.depth+1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=0===n.meta.depth?0:n.meta.depth-1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,o){e.children=qa(e.children);const[n]=o,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===n)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=n,r.meta.depth=i.meta.depth,e.setSelection([n]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>ml(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>el(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:o,focus:n=!0}=t,r=N(e);o&&o.selection&&r&&S.withoutNormalizing(o,(()=>{e.children=qa(e.children);const t=D.parent(o.selection.anchor.path);_.splitNodes(o,{at:o.selection,match:e=>B.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=o.children.slice()[i];_.removeNodes(o,{at:[i],match:e=>B.isElement(e),mode:"highest"});const l={id:G(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=al(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,o={}){const{applyChanges:n=!0}=o;e.selection=t,n&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,o={}){const{only:n=!1,allSelected:r=!1}=o,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(n)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=bl(t)}else e.selectedBlocks=bl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var o;const n=null!==(o=t.slate)&&void 0!==o?o:No(e);if(!n)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>Ol(e,n)),i):(Ol(e,n),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('#yoopta-editor .yoo-editor-pointer-events-none{pointer-events:none}#yoopta-editor .yoo-editor-absolute{position:absolute}#yoopta-editor .yoo-editor-relative{position:relative}#yoopta-editor .-yoo-editor-left-\\[50px\\]{left:-50px}#yoopta-editor .yoo-editor-left-0{left:0}#yoopta-editor .yoo-editor-right-\\[8px\\]{right:8px}#yoopta-editor .yoo-editor-top-0{top:0}#yoopta-editor .yoo-editor-top-\\[2px\\]{top:2px}#yoopta-editor .yoo-editor-top-\\[8px\\]{top:8px}#yoopta-editor .yoo-editor-z-10{z-index:10}#yoopta-editor .yoo-editor-z-\\[100\\]{z-index:100}#yoopta-editor .yoo-editor-z-\\[90\\]{z-index:90}#yoopta-editor .yoo-editor-m-\\[0_1px\\]{margin:0 1px}#yoopta-editor .yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}#yoopta-editor .yoo-editor-mb-\\[1px\\]{margin-bottom:1px}#yoopta-editor .yoo-editor-mr-2{margin-right:.5rem}#yoopta-editor .yoo-editor-mt-\\[2px\\]{margin-top:2px}#yoopta-editor .yoo-editor-flex{display:flex}#yoopta-editor .yoo-editor-h-4{height:1rem}#yoopta-editor .yoo-editor-h-\\[1px\\]{height:1px}#yoopta-editor .yoo-editor-h-\\[22px\\]{height:22px}#yoopta-editor .yoo-editor-h-\\[24px\\]{height:24px}#yoopta-editor .yoo-editor-h-full{height:100%}#yoopta-editor .yoo-editor-w-4{width:1rem}#yoopta-editor .yoo-editor-w-\\[18px\\]{width:18px}#yoopta-editor .yoo-editor-w-\\[22px\\]{width:22px}#yoopta-editor .yoo-editor-w-\\[24px\\]{width:24px}#yoopta-editor .yoo-editor-w-auto{width:auto}#yoopta-editor .yoo-editor-w-full{width:100%}#yoopta-editor .yoo-editor-min-w-\\[200px\\]{min-width:200px}#yoopta-editor .yoo-editor-cursor-default{cursor:default}#yoopta-editor .yoo-editor-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .yoo-editor-flex-col{flex-direction:column}#yoopta-editor .yoo-editor-items-center{align-items:center}#yoopta-editor .yoo-editor-justify-start{justify-content:flex-start}#yoopta-editor .yoo-editor-justify-center{justify-content:center}#yoopta-editor .yoo-editor-justify-between{justify-content:space-between}#yoopta-editor .yoo-editor-overflow-hidden{overflow:hidden}#yoopta-editor .yoo-editor-rounded{border-radius:.25rem}#yoopta-editor .yoo-editor-rounded-\\[2px\\]{border-radius:2px}#yoopta-editor .yoo-editor-rounded-\\[6px\\]{border-radius:6px}#yoopta-editor .yoo-editor-rounded-md{border-radius:.375rem}#yoopta-editor .yoo-editor-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-editor-border{border-width:1px}#yoopta-editor .yoo-editor-border-solid{border-style:solid}#yoopta-editor .yoo-editor-border-none{border-style:none}#yoopta-editor .yoo-editor-border-\\[\\#e5e7eb\\]{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}#yoopta-editor .yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}#yoopta-editor .yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-inherit{background-color:inherit}#yoopta-editor .yoo-editor-bg-transparent{background-color:transparent}#yoopta-editor .yoo-editor-p-0{padding:0}#yoopta-editor .yoo-editor-p-\\[0_4px\\]{padding:0 4px}#yoopta-editor .yoo-editor-px-0{padding-left:0;padding-right:0}#yoopta-editor .yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}#yoopta-editor .yoo-editor-py-0{padding-bottom:0;padding-top:0}#yoopta-editor .yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}#yoopta-editor .yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}#yoopta-editor .yoo-editor-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}#yoopta-editor .yoo-editor-opacity-0{opacity:0}#yoopta-editor .yoo-editor-opacity-100{opacity:1}#yoopta-editor .yoo-editor-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#yoopta-editor .yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-duration-150{transition-duration:.15s}#yoopta-editor .yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}#yoopta-editor .yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}#yoopta-editor *,#yoopta-editor :after,#yoopta-editor :before{box-sizing:border-box}#yoopta-editor button{background-color:transparent;border:none;cursor:pointer}#yoopta-editor blockquote,#yoopta-editor dd,#yoopta-editor dl,#yoopta-editor figure,#yoopta-editor h1,#yoopta-editor h2,#yoopta-editor h3,#yoopta-editor h4,#yoopta-editor h5,#yoopta-editor h6,#yoopta-editor hr,#yoopta-editor p,#yoopta-editor pre{margin:0}#yoopta-editor ::-moz-selection{background:#c6ddf8}#yoopta-editor ::selection{background:#c6ddf8}#yoopta-editor #yoopta-editor{height:auto;min-width:400px}#yoopta-editor .yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}#yoopta-editor .focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,#yoopta-editor .hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}#yoopta-editor .focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}#yoopta-editor .data-\\[hovered-state-open\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state-open=true]{opacity:1}');export{Mi as HOTKEYS,gl as UI,L as YooptaPlugin,Q as buildBlockData,J as buildBlockElement,El as createYooptaEditor,ll as createYooptaMark,yl as default,N as findPluginBlockBySelectionPath,vl as findPluginBlockByType,No as findSlateBySelectionPath,G as generateId,ii as getRootBlockElement,ri as getRootBlockElementType,H as useBlockData,Y as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,V as useYooptaPlugin,W as useYooptaPluginOptions,K as useYooptaReadOnly,ci as useYooptaTools};
13
+ function ea(e){return"[object Object]"===Object.prototype.toString.call(e)}var ta={isHistory(e){return!1!==ea(t=e)&&(void 0===(o=t.constructor)||!1!==ea(n=o.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||A.isOperationList(e.redos[0].operations))&&(0===e.undos.length||A.isOperationList(e.undos[0].operations));var t,o,n}},oa=new WeakMap,na=new WeakMap,ra={isHistoryEditor:e=>ta.isHistory(e.history)&&S.isEditor(e),isMerging:e=>na.get(e),isSaving:e=>oa.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var o=ra.isMerging(e);na.set(e,!1),t(),na.set(e,o)},withoutSaving(e,t){var o=ra.isSaving(e);oa.set(e,!1),t(),oa.set(e,o)}},ia=e=>{var t=e,{apply:o}=t;return t.history={undos:[],redos:[]},t.redo=()=>{var{history:e}=t,{redos:o}=e;if(o.length>0){var n=o[o.length-1];n.selectionBefore&&_.setSelection(t,n.selectionBefore),ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{for(var e of n.operations)t.apply(e)}))})),e.redos.pop(),t.writeHistory("undos",n)}},t.undo=()=>{var{history:e}=t,{undos:o}=e;if(o.length>0){var n=o[o.length-1];ra.withoutSaving(t,(()=>{S.withoutNormalizing(t,(()=>{var e=n.operations.map(A.inverse).reverse();for(var o of e)t.apply(o);n.selectionBefore&&_.setSelection(t,n.selectionBefore)}))})),t.writeHistory("redos",n),e.undos.pop()}},t.apply=e=>{var{operations:n,history:r}=t,{undos:i}=r,a=i[i.length-1],l=a&&a.operations[a.operations.length-1],c=ra.isSaving(t),s=ra.isMerging(t);if(null==c&&(c=la(e)),c){if(null==s&&(s=null!=a&&(0!==n.length||aa(e,l))),a&&s)a.operations.push(e);else{var d={operations:[e],selectionBefore:t.selection};t.writeHistory("undos",d)}for(;i.length>100;)i.shift();r.redos=[]}o(e)},t.writeHistory=(e,o)=>{t.history[e].push(o)},t},aa=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!D.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!D.equals(e.path,t.path)),la=(e,t)=>"set_selection"!==e.type,ca=Symbol.for("immer-nothing"),sa=Symbol.for("immer-draftable"),da=Symbol.for("immer-state");function ua(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fa=Object.getPrototypeOf;function pa(e){return!!e&&!!e[da]}function ha(e){return!!e&&(ga(e)||Array.isArray(e)||!!e[sa]||!!e.constructor?.[sa]||xa(e)||ka(e))}var ya=Object.prototype.constructor.toString();function ga(e){if(!e||"object"!=typeof e)return!1;const t=fa(e);if(null===t)return!0;const o=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return o===Object||"function"==typeof o&&Function.toString.call(o)===ya}function va(e,t){0===ma(e)?Reflect.ownKeys(e).forEach((o=>{t(o,e[o],e)})):e.forEach(((o,n)=>t(n,o,e)))}function ma(e){const t=e[da];return t?t.type_:Array.isArray(e)?1:xa(e)?2:ka(e)?3:0}function ba(e,t){return 2===ma(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wa(e,t,o){const n=ma(e);2===n?e.set(t,o):3===n?e.add(o):e[t]=o}function xa(e){return e instanceof Map}function ka(e){return e instanceof Set}function Ea(e){return e.copy_||e.base_}function Oa(e,t){if(xa(e))return new Map(e);if(ka(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&ga(e)){if(!fa(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const o=Object.getOwnPropertyDescriptors(e);delete o[da];let n=Reflect.ownKeys(o);for(let t=0;t<n.length;t++){const r=n[t],i=o[r];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(o[r]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[r]})}return Object.create(fa(e),o)}function Ca(e,t=!1){return _a(e)||pa(e)||!ha(e)||(ma(e)>1&&(e.set=e.add=e.clear=e.delete=Sa),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Ca(t,!0)))),e}function Sa(){ua(2)}function _a(e){return Object.isFrozen(e)}var Da,Ra={};function ja(e){const t=Ra[e];return t||ua(0),t}function Ba(){return Da}function Aa(e,t){t&&(ja("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ta(e){Ma(e),e.drafts_.forEach(Na),e.drafts_=null}function Ma(e){e===Da&&(Da=e.parent_)}function La(e){return Da={drafts_:[],parent_:Da,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Na(e){const t=e[da];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ia(e,t){t.unfinalizedDrafts_=t.drafts_.length;const o=t.drafts_[0];return void 0!==e&&e!==o?(o[da].modified_&&(Ta(t),ua(4)),ha(e)&&(e=Pa(t,e),t.parent_||za(t,e)),t.patches_&&ja("Patches").generateReplacementPatches_(o[da].base_,e,t.patches_,t.inversePatches_)):e=Pa(t,o,[]),Ta(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ca?e:void 0}function Pa(e,t,o){if(_a(t))return t;const n=t[da];if(!n)return va(t,((r,i)=>Fa(e,n,t,r,i,o))),t;if(n.scope_!==e)return t;if(!n.modified_)return za(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let r=t,i=!1;3===n.type_&&(r=new Set(t),t.clear(),i=!0),va(r,((r,a)=>Fa(e,n,t,r,a,o,i))),za(e,t,!1),o&&e.patches_&&ja("Patches").generatePatches_(n,o,e.patches_,e.inversePatches_)}return n.copy_}function Fa(e,t,o,n,r,i,a){if(pa(r)){const a=Pa(e,r,i&&t&&3!==t.type_&&!ba(t.assigned_,n)?i.concat(n):void 0);if(wa(o,n,a),!pa(a))return;e.canAutoFreeze_=!1}else a&&o.add(r);if(ha(r)&&!_a(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Pa(e,r),t&&t.scope_.parent_||"symbol"==typeof n||!Object.prototype.propertyIsEnumerable.call(o,n)||za(e,r)}}function za(e,t,o=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ca(t,o)}var Ha={get(e,t){if(t===da)return e;const o=Ea(e);if(!ba(o,t))return function(e,t,o){const n=Ka(t,o);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,o,t);const n=o[t];return e.finalized_||!ha(n)?n:n===Va(e.base_,t)?(Ya(e),e.copy_[t]=$a(n,e)):n},has:(e,t)=>t in Ea(e),ownKeys:e=>Reflect.ownKeys(Ea(e)),set(e,t,o){const n=Ka(Ea(e),t);if(n?.set)return n.set.call(e.draft_,o),!0;if(!e.modified_){const n=Va(Ea(e),t),a=n?.[da];if(a&&a.base_===o)return e.copy_[t]=o,e.assigned_[t]=!1,!0;if(((r=o)===(i=n)?0!==r||1/r==1/i:r!=r&&i!=i)&&(void 0!==o||ba(e.base_,t)))return!0;Ya(e),Wa(e)}var r,i;return e.copy_[t]===o&&(void 0!==o||t in e.copy_)||Number.isNaN(o)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=o,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Va(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ya(e),Wa(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const o=Ea(e),n=Reflect.getOwnPropertyDescriptor(o,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:o[t]}:n},defineProperty(){ua(11)},getPrototypeOf:e=>fa(e.base_),setPrototypeOf(){ua(12)}},Ua={};function Va(e,t){const o=e[da];return(o?Ea(o):e)[t]}function Ka(e,t){if(!(t in e))return;let o=fa(e);for(;o;){const e=Object.getOwnPropertyDescriptor(o,t);if(e)return e;o=fa(o)}}function Wa(e){e.modified_||(e.modified_=!0,e.parent_&&Wa(e.parent_))}function Ya(e){e.copy_||(e.copy_=Oa(e.base_,e.scope_.immer_.useStrictShallowCopy_))}va(Ha,((e,t)=>{Ua[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ua.deleteProperty=function(e,t){return Ua.set.call(this,e,t,void 0)},Ua.set=function(e,t,o){return Ha.set.call(this,e[0],t,o,e[0])};function $a(e,t){const o=xa(e)?ja("MapSet").proxyMap_(e,t):ka(e)?ja("MapSet").proxySet_(e,t):function(e,t){const o=Array.isArray(e),n={type_:o?1:0,scope_:t?t.scope_:Ba(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=n,i=Ha;o&&(r=[n],i=Ua);const{revoke:a,proxy:l}=Proxy.revocable(r,i);return n.draft_=l,n.revoke_=a,l}(e,t);return(t?t.scope_:Ba()).drafts_.push(o),o}function Xa(e){if(!ha(e)||_a(e))return e;const t=e[da];let o;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,o=Oa(e,t.scope_.immer_.useStrictShallowCopy_)}else o=Oa(e,!0);return va(o,((e,t)=>{wa(o,e,Xa(t))})),t&&(t.finalized_=!1),o}var Za=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,o)=>{if("function"==typeof e&&"function"!=typeof t){const o=t;t=e;const n=this;return function(e=o,...r){return n.produce(e,(e=>t.call(this,e,...r)))}}let n;if("function"!=typeof t&&ua(6),void 0!==o&&"function"!=typeof o&&ua(7),ha(e)){const r=La(this),i=$a(e,void 0);let a=!0;try{n=t(i),a=!1}finally{a?Ta(r):Ma(r)}return Aa(r,o),Ia(n,r)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===ca&&(n=void 0),this.autoFreeze_&&Ca(n,!0),o){const t=[],r=[];ja("Patches").generateReplacementPatches_(e,n,t,r),o(t,r)}return n}ua(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...o)=>this.produceWithPatches(t,(t=>e(t,...o)));let o,n;return[this.produce(e,t,((e,t)=>{o=e,n=t})),o,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ha(e)||ua(8),pa(e)&&(e=function(e){pa(e)||ua(10);return Xa(e)}(e));const t=La(this),o=$a(e,void 0);return o[da].isManual_=!0,Ma(t),o}finishDraft(e,t){const o=e&&e[da];o&&o.isManual_||ua(9);const{scope_:n}=o;return Aa(n,t),Ia(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let o;for(o=t.length-1;o>=0;o--){const n=t[o];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}o>-1&&(t=t.slice(o+1));const n=ja("Patches").applyPatches_;return pa(e)?n(e,t):this.produce(e,(e=>n(e,t)))}};Za.produce,Za.produceWithPatches.bind(Za),Za.setAutoFreeze.bind(Za),Za.setUseStrictShallowCopy.bind(Za),Za.applyPatches.bind(Za);var qa=Za.createDraft.bind(Za),Ga=Za.finishDraft.bind(Za);function Ja(e,t){const o=No(e);if(!o)return!1;const n=S.marks(o);return!!(null==n?void 0:n[t])}const Qa=(e,t)=>{const{insertText:o}=t;return t.insertText=n=>{var r;const{selection:i}=t;if(" "===n&&i&&R.isCollapsed(i)){const{anchor:a}=i,l=S.above(t,{match:e=>B.isElement(e)&&S.isBlock(t,e),mode:"lowest"});if(!l)return;const[,c]=l,s=S.parent(t,c),[d]=s;if(B.isElement(d)&&!j.isText(d.children[0]))return o(n);const u=l?c:[],f={anchor:a,focus:S.start(t,u)},p=S.string(t,f),h=null===(r=e.shortcuts)||void 0===r?void 0:r[p];if(!!h&&!h.isActive())return _.select(t,f),_.delete(t),void h.create({deleteText:!1})}o(n)},t};function el(e,t,o){e.children=qa(e.children);let n=!1;const r=e.children[t];if(!r)throw Error(`Block with id ${t} not found`);o.id&&(r.id=o.id,n=!0),o.type&&(r.type=o.type,n=!0),o.meta&&(r.meta=o.meta,n=!0),o.value&&(r.value=o.value),e.children=Ga(e.children),n&&e.applyChanges(),e.emit("change",e.children)}const tl="Paragraph";function ol(e,t,o){e.children=qa(e.children);const n=N(e,{at:(null==o?void 0:o.at)||e.selection});if(!n)throw new Error("Block from not found at current selection");let r=t;n.type===r&&(r=tl);const i=No(e,{at:[n.meta.order]});if(!i)throw new Error(`Slate not found for block in position ${n.meta.order}`);const a=ri(e.blocks[r].elements);S.withoutNormalizing(i,(()=>{_.setNodes(i,{type:a},{at:[0],mode:"lowest",match:e=>B.isElement(e)&&!S.isInline(i,e)}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const t={id:n.id,type:r,meta:Object.assign(Object.assign({},n.meta),{order:n.meta.order}),value:i.children};e.blockEditorsMap[n.id]=i,e.children[n.id]=t,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(t.id,{slate:i})}))}function nl(e,t={}){const{at:o=e.selection,deleteAll:n=!1,fromPaths:r,focus:i}=t;if(Array.isArray(r)&&r.length>0){e.children=qa(e.children),r.forEach((t=>{const o=N(e,{at:[t]});o&&(delete e.children[o.id],delete e.blockEditorsMap[o.id])}));return Object.keys(e.children).forEach(((t,o)=>{e.children[t].meta.order=o})),e.children=Ga(e.children),e.applyChanges(),void e.emit("change",e.children)}if(n||1===Object.keys(e.children).length){e.children={},e.blockEditorsMap={};const t=Q({id:G()}),o=ll(e);return e.children[t.id]=t,e.blockEditorsMap[t.id]=o,e.setSelection([0]),e.setBlockSelected(null),e.focusBlock(t.id,{slate:o,waitExecution:!0}),e.applyChanges(),void e.emit("change",e.children)}if(!o)return;e.children=qa(e.children);const[a]=o,l=Object.keys(e.children),c=l.find((t=>e.children[t].meta.order===a));if(l.forEach((t=>{const o=e.children[t];o.meta.order>a&&(o.meta.order-=1)})),c&&(delete e.children[c],delete e.blockEditorsMap[c]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),i){const o=e.selection?e.selection[0]-1:0,n=N(e,{at:[o]});n&&e.focusBlock(n.id,{focusAt:t.focusAt})}}function rl(e,t){const o={};return t.forEach((t=>{const n=t.type;o[n]={hotkey:t.hotkey,type:n,getValue:()=>function(e,t){const o=No(e);if(!o)return null;const n=S.marks(o);return null==n?void 0:n[t]}(e,n),isActive:()=>Ja(e,n),toggle:()=>function(e,t){const o=No(e),n=Ja(e,t);o&&(n?S.removeMark(o,t):S.addMark(o,t,!0),e.applyChanges(),e.emit("change",e.children))}(e,n),update:t=>function(e,t,o){const n=No(e);n&&n.selection&&R.isExpanded(n.selection)&&(S.addMark(n,t,o),e.applyChanges(),e.emit("change",e.children))}(e,n,t)}})),o}function il(e,t){const o={};return t.forEach(((t,n)=>{var r;const i=ii(t.elements),a=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.nodeType;if(!("inline"===a||"inlineVoid"===a)){const n={};Object.keys(t.elements).forEach((e=>{const o=vi(t.elements[e],["render"]);n[e]=o}));const{display:r,placeholder:i,align:a,shortcuts:l}=t.options||{};o[t.type]={type:t.type,elements:n,hasCustomEditor:!!t.customEditor,options:{display:r,placeholder:i,align:a,shortcuts:l},isActive:()=>{const o=N(e,{at:e.selection});return(null==o?void 0:o.type)===t.type},toggle:o=>{ol(e,t.type,o)},create:o=>{!function(e,t,o){var n;e.children=qa(e.children);const r=N(e);if(!r)throw new Error(`No block found in the current selection path. Passed path: ${e.selection}`);const i=(null==o?void 0:o.slate)||No(e,{at:[null==r?void 0:r.meta.order]});if(!i||!i.selection)return;const a=e.blocks[t],l=ri(a.elements),c=a.elements[l];if(!c)return;const s=Object.assign({nodeType:(null===(n=c.props)||void 0===n?void 0:n.nodeType)||"block"},c.props),d=J({id:G(),type:l,props:s});_.setNodes(i,d,{at:[0,0],match:e=>B.isElement(e),mode:"highest"}),(null==o?void 0:o.deleteText)&&_.delete(i,{at:[0,0]});const u=Q({id:r.id,type:a.type,meta:{order:r.meta.order,depth:r.meta.depth},value:[d]}),f=u.id;e.children[f]=u,e.blockEditorsMap[f]=i,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),(null==o?void 0:o.focus)&&e.focusBlock(f,{slate:i,waitExecution:!0})}(e,t.type,o)},update:(t,o)=>{el(e,t,o)},updateElement:(t,o,n)=>{!function(e,t,o,n){const r=e.children[t];if(!r)throw new Error(`Block with id ${t} not found`);const i=No(e,{at:[r.meta.order]});i?S.withoutNormalizing(i,(()=>{const[t]=S.nodes(i,{at:[0],match:e=>B.isElement(e)&&e.type===o}),r=null==t?void 0:t[0],a=(null==r?void 0:r.props)||{},l={props:Object.assign(Object.assign({},a),n)};_.setNodes(i,l,{at:[0],match:e=>B.isElement(e)&&e.type===o,mode:"lowest"}),e.applyChanges(),e.emit("change",e.children)})):console.warn("No slate found")}(e,t,o,n)},delete:t=>{nl(e,t)}}}})),o}function al(e){const t={};return Object.keys(e.children).forEach((o=>{const n=ll(e);t[o]=n})),t}function ll(e){return Qa(e,ia(C(T())))}function cl({type:e,hotkey:t,render:o}){return{type:e,hotkey:t,render:o}}const sl=cl({type:"fakeSelection",render:t=>e("span",Object.assign({style:{backgroundColor:"#d7e6fa"}},{children:t.children}))}),dl=(()=>{const e=G();return{[e]:Q({id:e})}})(),ul=new Z,fl=(e,t)=>ul.on(e,t),pl=(e,t)=>ul.once(e,t),hl=(e,t)=>ul.off(e,t),yl=(e,t)=>ul.emit(e,t);const gl=({editor:o,value:n,marks:r,plugins:i,autoFocus:a,className:l,tools:c,selectionBoxRoot:s,children:u,placeholder:p,readOnly:h,width:y})=>{const g=()=>{w((e=>Object.assign(Object.assign({},e),{version:e.version+1})))},v=d((()=>r?[sl,...r]:[sl]),[r]),m=d((()=>i.map((e=>e.getPlugin))),[i]),[b,w]=f((()=>{o.applyChanges=g,o.readOnly=h||!1,v&&(o.formats=rl(o,v)),o.blocks=il(o,m);const e=function(e){return!!e&&"object"==typeof e&&0!==Object.keys(e).length}(n);return e||void 0===n||console.error(`Initial value is not valid. Should be an object with blocks. You passed: ${JSON.stringify(n)}`),o.children=e?n:dl,o.blockEditorsMap=al(o),o.shortcuts=function(e){const t={};return Object.values(e.blocks).forEach((e=>{var o,n,r,i;e.options&&Array.isArray(null===(o=e.options)||void 0===o?void 0:o.shortcuts)&&(null===(n=e.options)||void 0===n?void 0:n.shortcuts.length)>0&&(null===(i=null===(r=e.options)||void 0===r?void 0:r.shortcuts)||void 0===i||i.forEach((o=>{t[o]=e})))})),t}(o),o.plugins=function(e){const t={},o={};return e.forEach((e=>{e.elements&&Object.keys(e.elements).forEach((t=>{var n;const r=e.elements[t],i=null===(n=r.props)||void 0===n?void 0:n.nodeType;"inline"!==i&&"inlineVoid"!==i||(o[t]=r)})),t[e.type]=e})),e.forEach((e=>{if(e.elements){const n=Object.assign(Object.assign({},e.elements),o);t[e.type]=Object.assign(Object.assign({},e),{elements:n})}})),t}(m),o.on=fl,o.once=pl,o.off=hl,o.emit=yl,{editor:o,version:0}}));return(e=>!!(Array.isArray(e)&&e.length>0)&&e.some((e=>{if(e.id||e.nodeType||e.type||e.children)return!0})))(n)?(console.error("Legacy version of Yoopta-Editor in use"),t("div",{children:[e("h1",{children:"Legacy version of the Yoopta-Editor is used"}),e("p",{children:"It looks like you are using a legacy version of the editor."}),t("p",{children:["The structure of value has changed in new ",e("b",{children:"@v4"})," version"]}),t("p",{children:["Please, check the migration guide to update your editor to the new ",e("b",{children:"@v4"})," version.",e("a",{href:""})]}),t("p",{children:["If you have specific case please"," ",e("a",Object.assign({href:"https://github.com/Darginec05/Yoopta-Editor/issues",target:"_blank",rel:"noopener noreferrer"},{children:"open the issue"}))," ","and we will solve your problem with migration"]})]})):e(Qi,{children:e(F,Object.assign({editorState:b},{children:t(li,Object.assign({tools:c},{children:[e(Ji,{placeholder:p,marks:v,autoFocus:a,className:l,selectionBoxRoot:s,width:y}),u]}))}))})},vl=Object.assign(Object.assign({},hi),{ExtendedBlockActions:({id:n,className:r,style:i,onClick:a,children:l})=>{const c=K(),[s,d]=f(!1),{refs:u,floatingStyles:p,context:h}=Pr({placement:"bottom-start",open:s,onOpenChange:d,middleware:[Un(),Hn(),zn(),En(10)],whileElementsMounted:Fn}),{isMounted:y,styles:g}=Ur(h,{duration:100}),v=Object.assign(Object.assign({},g),p);return c?null:t(o,{children:[y&&e(pi,Object.assign({isOpen:!0,onClose:()=>d(!1),refs:u,style:v},{children:l})),e("button",Object.assign({type:"button",ref:u.setReference,id:n,className:`yoo-editor-absolute yoo-editor-right-[8px] yoo-editor-top-[8px] yoo-editor-flex yoo-editor-items-center yoo-editor-justify-between yoo-editor-z-10 yoo-editor-opacity-1 yoo-editor-bg-[#eee] yoo-editor-w-[22px] yoo-editor-h-[22px] yoo-editor-transition-opacity yoo-editor-duration-150 yoo-editor-ease-in yoo-editor-border-none yoo-editor-cursor-pointer yoo-editor-rounded-[2px] yoo-editor-p-[0_4px] ${r||""} yoopta-extended-block-actions`,onClick:()=>{null==a||a(),d(!0)},style:s?Object.assign(Object.assign({},i),{opacity:1}):i},{children:e(qr,{})}))]})}});function ml(e,t){const o=Object.keys(e.children),{type:n}=t||{},r=o.find((t=>e.children[t].type===n));return r?e.children[r]:null}function bl(e,t,o={}){try{const{focusAt:n,waitExecution:r=!0,waitExecutionMs:i=0,shouldUpdateBlockSelection:a=!0}=o,l=()=>{const r=o.slate||e.blockEditorsMap[t],i=e.children[t];if(!r||!i)return;if(!e.blocks[i.type].hasCustomEditor){const e=function(e,t){if(M.isPoint(t))return t;if(D.isPath(t))return{path:t,offset:0};const[,o]=S.first(e,[0]);return{path:o||[0,0],offset:0}}(r,n);_.select(r,e),w.focus(r)}a&&setTimeout((()=>{e.setSelection([i.meta.order])}),0)};r?setTimeout((()=>l()),i):l()}catch(e){}}function wl(e){return Array.from(new Set(e))}var xl={};!function(e,t){var o="__lodash_hash_undefined__",n=9007199254740991,r="[object Arguments]",i="[object Boolean]",a="[object Date]",l="[object Function]",c="[object GeneratorFunction]",s="[object Map]",d="[object Number]",u="[object Object]",f="[object Promise]",p="[object RegExp]",h="[object Set]",y="[object String]",g="[object Symbol]",v="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",_="[object Uint16Array]",D="[object Uint32Array]",R=/\w*$/,j=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,A={};A[r]=A["[object Array]"]=A[m]=A[b]=A[i]=A[a]=A[w]=A[x]=A[k]=A[E]=A[O]=A[s]=A[d]=A[u]=A[p]=A[h]=A[y]=A[g]=A[C]=A[S]=A[_]=A[D]=!0,A["[object Error]"]=A[l]=A[v]=!1;var T="object"==typeof $&&$&&$.Object===Object&&$,M="object"==typeof self&&self&&self.Object===Object&&self,L=T||M||Function("return this")(),N=t&&!t.nodeType&&t,I=N&&e&&!e.nodeType&&e,P=I&&I.exports===N;function F(e,t){return e.set(t[0],t[1]),e}function z(e,t){return e.add(t),e}function H(e,t,o,n){var r=-1,i=e?e.length:0;for(n&&i&&(o=e[++r]);++r<i;)o=t(o,e[r],r,e);return o}function U(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function V(e){var t=-1,o=Array(e.size);return e.forEach((function(e,n){o[++t]=[n,e]})),o}function K(e,t){return function(o){return e(t(o))}}function W(e){var t=-1,o=Array(e.size);return e.forEach((function(e){o[++t]=e})),o}var Y,X=Array.prototype,Z=Function.prototype,q=Object.prototype,G=L["__core-js_shared__"],J=(Y=/[^.]+$/.exec(G&&G.keys&&G.keys.IE_PROTO||""))?"Symbol(src)_1."+Y:"",Q=Z.toString,ee=q.hasOwnProperty,te=q.toString,oe=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ne=P?L.Buffer:void 0,re=L.Symbol,ie=L.Uint8Array,ae=K(Object.getPrototypeOf,Object),le=Object.create,ce=q.propertyIsEnumerable,se=X.splice,de=Object.getOwnPropertySymbols,ue=ne?ne.isBuffer:void 0,fe=K(Object.keys,Object),pe=Pe(L,"DataView"),he=Pe(L,"Map"),ye=Pe(L,"Promise"),ge=Pe(L,"Set"),ve=Pe(L,"WeakMap"),me=Pe(Object,"create"),be=Ve(pe),we=Ve(he),xe=Ve(ye),ke=Ve(ge),Ee=Ve(ve),Oe=re?re.prototype:void 0,Ce=Oe?Oe.valueOf:void 0;function Se(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function _e(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function De(e){var t=-1,o=e?e.length:0;for(this.clear();++t<o;){var n=e[t];this.set(n[0],n[1])}}function Re(e){this.__data__=new _e(e)}function je(e,t){var o=We(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ye(e)}(e)&&ee.call(e,"callee")&&(!ce.call(e,"callee")||te.call(e)==r)}(e)?function(e,t){for(var o=-1,n=Array(e);++o<e;)n[o]=t(o);return n}(e.length,String):[],n=o.length,i=!!n;for(var a in e)!t&&!ee.call(e,a)||i&&("length"==a||He(a,n))||o.push(a);return o}function Be(e,t,o){var n=e[t];ee.call(e,t)&&Ke(n,o)&&(void 0!==o||t in e)||(e[t]=o)}function Ae(e,t){for(var o=e.length;o--;)if(Ke(e[o][0],t))return o;return-1}function Te(e,t,o,n,f,v,j){var B;if(n&&(B=v?n(e,f,v,j):n(e)),void 0!==B)return B;if(!Ze(e))return e;var T=We(e);if(T){if(B=function(e){var t=e.length,o=e.constructor(t);t&&"string"==typeof e[0]&&ee.call(e,"index")&&(o.index=e.index,o.input=e.input);return o}(e),!t)return function(e,t){var o=-1,n=e.length;t||(t=Array(n));for(;++o<n;)t[o]=e[o];return t}(e,B)}else{var M=ze(e),L=M==l||M==c;if($e(e))return function(e,t){if(t)return e.slice();var o=new e.constructor(e.length);return e.copy(o),o}(e,t);if(M==u||M==r||L&&!v){if(U(e))return v?e:{};if(B=function(e){return"function"!=typeof e.constructor||Ue(e)?{}:(t=ae(e),Ze(t)?le(t):{});var t}(L?{}:e),!t)return function(e,t){return Ne(e,Fe(e),t)}(e,function(e,t){return e&&Ne(t,qe(t),e)}(B,e))}else{if(!A[M])return v?e:{};B=function(e,t,o,n){var r=e.constructor;switch(t){case m:return Le(e);case i:case a:return new r(+e);case b:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.byteLength)}(e,n);case w:case x:case k:case E:case O:case C:case S:case _:case D:return function(e,t){var o=t?Le(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}(e,n);case s:return function(e,t,o){var n=t?o(V(e),!0):V(e);return H(n,F,new e.constructor)}(e,n,o);case d:case y:return new r(e);case p:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case h:return function(e,t,o){var n=t?o(W(e),!0):W(e);return H(n,z,new e.constructor)}(e,n,o);case g:return l=e,Ce?Object(Ce.call(l)):{}}var l}(e,M,Te,t)}}j||(j=new Re);var N=j.get(e);if(N)return N;if(j.set(e,B),!T)var I=o?function(e){return function(e,t,o){var n=t(e);return We(e)?n:function(e,t){for(var o=-1,n=t.length,r=e.length;++o<n;)e[r+o]=t[o];return e}(n,o(e))}(e,qe,Fe)}(e):qe(e);return function(e,t){for(var o=-1,n=e?e.length:0;++o<n&&!1!==t(e[o],o,e););}(I||e,(function(r,i){I&&(r=e[i=r]),Be(B,i,Te(r,t,o,n,i,e,j))})),B}function Me(e){return!(!Ze(e)||(t=e,J&&J in t))&&(Xe(e)||U(e)?oe:j).test(Ve(e));var t}function Le(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ne(e,t,o,n){o||(o={});for(var r=-1,i=t.length;++r<i;){var a=t[r],l=n?n(o[a],e[a],a,o,e):void 0;Be(o,a,void 0===l?e[a]:l)}return o}function Ie(e,t){var o,n,r=e.__data__;return("string"==(n=typeof(o=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==o:null===o)?r["string"==typeof t?"string":"hash"]:r.map}function Pe(e,t){var o=function(e,t){return null==e?void 0:e[t]}(e,t);return Me(o)?o:void 0}Se.prototype.clear=function(){this.__data__=me?me(null):{}},Se.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Se.prototype.get=function(e){var t=this.__data__;if(me){var n=t[e];return n===o?void 0:n}return ee.call(t,e)?t[e]:void 0},Se.prototype.has=function(e){var t=this.__data__;return me?void 0!==t[e]:ee.call(t,e)},Se.prototype.set=function(e,t){return this.__data__[e]=me&&void 0===t?o:t,this},_e.prototype.clear=function(){this.__data__=[]},_e.prototype.delete=function(e){var t=this.__data__,o=Ae(t,e);return!(o<0)&&(o==t.length-1?t.pop():se.call(t,o,1),!0)},_e.prototype.get=function(e){var t=this.__data__,o=Ae(t,e);return o<0?void 0:t[o][1]},_e.prototype.has=function(e){return Ae(this.__data__,e)>-1},_e.prototype.set=function(e,t){var o=this.__data__,n=Ae(o,e);return n<0?o.push([e,t]):o[n][1]=t,this},De.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||_e),string:new Se}},De.prototype.delete=function(e){return Ie(this,e).delete(e)},De.prototype.get=function(e){return Ie(this,e).get(e)},De.prototype.has=function(e){return Ie(this,e).has(e)},De.prototype.set=function(e,t){return Ie(this,e).set(e,t),this},Re.prototype.clear=function(){this.__data__=new _e},Re.prototype.delete=function(e){return this.__data__.delete(e)},Re.prototype.get=function(e){return this.__data__.get(e)},Re.prototype.has=function(e){return this.__data__.has(e)},Re.prototype.set=function(e,t){var o=this.__data__;if(o instanceof _e){var n=o.__data__;if(!he||n.length<199)return n.push([e,t]),this;o=this.__data__=new De(n)}return o.set(e,t),this};var Fe=de?K(de,Object):function(){return[]},ze=function(e){return te.call(e)};function He(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||q)}function Ve(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ke(e,t){return e===t||e!=e&&t!=t}(pe&&ze(new pe(new ArrayBuffer(1)))!=b||he&&ze(new he)!=s||ye&&ze(ye.resolve())!=f||ge&&ze(new ge)!=h||ve&&ze(new ve)!=v)&&(ze=function(e){var t=te.call(e),o=t==u?e.constructor:void 0,n=o?Ve(o):void 0;if(n)switch(n){case be:return b;case we:return s;case xe:return f;case ke:return h;case Ee:return v}return t});var We=Array.isArray;function Ye(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Xe(e)}var $e=ue||function(){return!1};function Xe(e){var t=Ze(e)?te.call(e):"";return t==l||t==c}function Ze(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function qe(e){return Ye(e)?je(e):function(e){if(!Ue(e))return fe(e);var t=[];for(var o in Object(e))ee.call(e,o)&&"constructor"!=o&&t.push(o);return t}(e)}e.exports=function(e){return Te(e,!0,!0)}}({get exports(){return xl},set exports(e){xl=e}},xl);var kl=xl;function El(e,t={}){const{blockId:o,focus:n}=t;if(!o&&!t.at)throw new Error("blockId or path should be provided");let r=null;if(o&&(r=e.children[o],!r))throw new Error(`Block not with blockId: ${o} found`);if(t.at&&(r=N(e,{at:t.at}),!r))throw new Error(`Block in path ${t.at} not found`);if(!r)throw new Error("Block not found");e.children=qa(e.children);Object.values(e.children).forEach((e=>{e.meta.order>r.meta.order&&(e.meta.order+=1)}));const i=(a=r,"function"==typeof window.structuredClone?window.structuredClone(a):kl(a));var a;const l=ll(e);i.id=G(),i.meta.order=r.meta.order+1,e.children[i.id]=i,e.blockEditorsMap[i.id]=l;const c=i.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(c,{waitExecution:!0})}function Ol(e,t){w.blur(t),w.deselect(t),_.deselect(t),e.setBlockSelected(null),e.setSelection(null)}const Cl=()=>{const e={children:{},selection:null,selectedBlocks:null,readOnly:!1,getEditorValue:()=>function(e){return e.applyChanges(),e.children}(e),setEditorValue:(...t)=>function(e,t){e.children=t,e.blockEditorsMap=al(e),e.applyChanges()}(e,...t),applyChanges:()=>{},insertBlock:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n=null,focus:r=!1,slate:i=null}=o,a=N(e),l=n,c={id:G(),value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:0})};let s=!1;if(i&&i.selection){const e=S.string(i,i.selection.anchor.path);s=S.isStart(i,i.selection.anchor,i.selection.anchor.path)&&e.length>0}if(l){const[t]=l;Object.values(e.children).forEach((e=>{e.meta.order>=t&&(e.meta.order+=1)})),c.meta.order=t}else{const t=Object.keys(e.children).length;c.meta.order=t}const d=ll(e);e.blockEditorsMap[c.id]=d,s&&a&&(c.meta.order=a.meta.order,a.meta.order+=1),e.children[c.id]=c;const u=null==a?void 0:a.id;e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.focusBlock(s&&u?u:c.id)}(e,...t),insertBlocks:(...t)=>function(e,t,o={}){e.children=qa(e.children);const{at:n,focus:r}=o;let i=n||[0];const a=N(e),l=No(e);let c=!1,s=!1;if(l&&l.selection){const t=D.parent(l.selection.anchor.path),o=S.string(l,t).trim(),n=S.isStart(l,l.selection.anchor,t);c=""===o&&n,s=!n||o.length>0,w.blur(l),e.setSelection(null)}s&&(i=[i[0]+1]),Object.values(e.children).forEach((e=>{e.meta.order>=i[0]&&(e.meta.order+=t.length)}));const d=[];if(t.forEach(((t,o)=>{const n={id:t.id,value:t.value,type:t.type,meta:Object.assign(Object.assign({},t.meta),{order:i[0]+o})};d.push(n.meta.order),e.children[n.id]=n;const r=ll(e);e.blockEditorsMap[n.id]=r})),a&&c){const t=a.meta.order;delete e.children[a.id],delete e.blockEditorsMap[a.id],Object.keys(e.children).forEach((o=>{const n=e.children[o];n.meta.order>t&&(n.meta.order-=1)}))}e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),r&&e.setBlockSelected(d)}(e,...t),deleteBlock:(...t)=>nl(e,...t),duplicateBlock:(...t)=>El(e,...t),toggleBlock:(...t)=>ol(e,...t),increaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=n.meta.depth+1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),decreaseBlockDepth:(...t)=>function(e,t={}){const{at:o=e.selection}=t;if(!o)return;e.children=qa(e.children);const n=N(e);n&&(n.meta.depth=0===n.meta.depth?0:n.meta.depth-1,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children))}(e,...t),moveBlock:(...t)=>function(e,t,o){e.children=qa(e.children);const[n]=o,r=e.children[t],i=Object.values(e.children).find((e=>e.meta.order===n)),a=r.meta.order<i.meta.order,l=r.meta.order>i.meta.order;Object.values(e.children).forEach((e=>{a?e.meta.order>r.meta.order&&e.meta.order<=i.meta.order&&e.meta.order--:l&&e.meta.order<r.meta.order&&e.meta.order>=i.meta.order&&e.meta.order++})),r.meta.order=n,r.meta.depth=i.meta.depth,e.setSelection([n]),e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children)}(e,...t),focusBlock:(...t)=>bl(e,...t),getBlock:(...e)=>{},updateBlock:(...t)=>el(e,...t),splitBlock:(...t)=>function(e,t={}){const{slate:o,focus:n=!0}=t,r=N(e);o&&o.selection&&r&&S.withoutNormalizing(o,(()=>{e.children=qa(e.children);const t=D.parent(o.selection.anchor.path);_.splitNodes(o,{at:o.selection,match:e=>B.isElement(e),always:!0,mode:"highest"});const i=t[0]+1,a=o.children.slice()[i];_.removeNodes(o,{at:[i],match:e=>B.isElement(e),mode:"highest"});const l={id:G(),type:r.type,meta:{order:r.meta.order+1,depth:r.meta.depth},value:[a]};Object.values(e.children).forEach((e=>{e.meta.order>=l.meta.order&&(e.meta.order+=1)}));const c=ll(e);e.blockEditorsMap[l.id]=c,e.children[l.id]=l,e.children=Ga(e.children),e.applyChanges(),e.emit("change",e.children),n&&e.focusBlock(l.id,{slate:c})}))}(e,...t),setSelection:(...t)=>function(e,t,o={}){const{applyChanges:n=!0}=o;e.selection=t,n&&e.applyChanges()}(e,...t),setBlockSelected:(...t)=>function(e,t,o={}){const{only:n=!1,allSelected:r=!1}=o,i=e.selectedBlocks||[];if(null===t)e.selectedBlocks=null;else if(t.length>1)e.selectedBlocks=t;else if(n)e.selectedBlocks=t;else if(r){const t=Object.keys(e.children).map(((e,t)=>t));e.selectedBlocks=wl(t)}else e.selectedBlocks=wl(i.concat(t));e.applyChanges()}(e,...t),blur:(...t)=>function(e,t={}){var o;const n=null!==(o=t.slate)&&void 0!==o?o:No(e);if(!n)return;const{waitExecution:r,waitExecutionMs:i}=t;r?setTimeout((()=>Ol(e,n)),i):(Ol(e,n),e.applyChanges())}(e,...t),blockEditorsMap:{},blocks:{},formats:{},shortcuts:{},plugins:{},on:(e,t)=>{},off:(e,t)=>{},emit:(e,...t)=>{},once:(e,t)=>{}};return e};!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('#yoopta-editor .yoo-editor-pointer-events-none{pointer-events:none}#yoopta-editor .yoo-editor-absolute{position:absolute}#yoopta-editor .yoo-editor-relative{position:relative}#yoopta-editor .-yoo-editor-left-\\[50px\\]{left:-50px}#yoopta-editor .yoo-editor-left-0{left:0}#yoopta-editor .yoo-editor-right-\\[8px\\]{right:8px}#yoopta-editor .yoo-editor-top-0{top:0}#yoopta-editor .yoo-editor-top-\\[2px\\]{top:2px}#yoopta-editor .yoo-editor-top-\\[8px\\]{top:8px}#yoopta-editor .yoo-editor-z-10{z-index:10}#yoopta-editor .yoo-editor-z-\\[100\\]{z-index:100}#yoopta-editor .yoo-editor-z-\\[90\\]{z-index:90}#yoopta-editor .yoo-editor-m-\\[0_1px\\]{margin:0 1px}#yoopta-editor .yoo-editor-mx-\\[4px\\]{margin-left:4px;margin-right:4px}#yoopta-editor .yoo-editor-my-\\[4px\\]{margin-bottom:4px;margin-top:4px}#yoopta-editor .yoo-editor-mb-\\[1px\\]{margin-bottom:1px}#yoopta-editor .yoo-editor-mr-2{margin-right:.5rem}#yoopta-editor .yoo-editor-mt-\\[2px\\]{margin-top:2px}#yoopta-editor .yoo-editor-flex{display:flex}#yoopta-editor .yoo-editor-h-4{height:1rem}#yoopta-editor .yoo-editor-h-\\[1px\\]{height:1px}#yoopta-editor .yoo-editor-h-\\[22px\\]{height:22px}#yoopta-editor .yoo-editor-h-\\[24px\\]{height:24px}#yoopta-editor .yoo-editor-h-full{height:100%}#yoopta-editor .yoo-editor-w-4{width:1rem}#yoopta-editor .yoo-editor-w-\\[18px\\]{width:18px}#yoopta-editor .yoo-editor-w-\\[22px\\]{width:22px}#yoopta-editor .yoo-editor-w-\\[24px\\]{width:24px}#yoopta-editor .yoo-editor-w-auto{width:auto}#yoopta-editor .yoo-editor-w-full{width:100%}#yoopta-editor .yoo-editor-min-w-\\[200px\\]{min-width:200px}#yoopta-editor .yoo-editor-cursor-default{cursor:default}#yoopta-editor .yoo-editor-cursor-pointer{cursor:pointer}#yoopta-editor .yoo-editor-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .yoo-editor-flex-col{flex-direction:column}#yoopta-editor .yoo-editor-items-center{align-items:center}#yoopta-editor .yoo-editor-justify-start{justify-content:flex-start}#yoopta-editor .yoo-editor-justify-center{justify-content:center}#yoopta-editor .yoo-editor-justify-between{justify-content:space-between}#yoopta-editor .yoo-editor-overflow-hidden{overflow:hidden}#yoopta-editor .yoo-editor-rounded{border-radius:.25rem}#yoopta-editor .yoo-editor-rounded-\\[2px\\]{border-radius:2px}#yoopta-editor .yoo-editor-rounded-\\[6px\\]{border-radius:6px}#yoopta-editor .yoo-editor-rounded-md{border-radius:.375rem}#yoopta-editor .yoo-editor-rounded-sm{border-radius:.125rem}#yoopta-editor .yoo-editor-border{border-width:1px}#yoopta-editor .yoo-editor-border-solid{border-style:solid}#yoopta-editor .yoo-editor-border-none{border-style:none}#yoopta-editor .yoo-editor-border-\\[\\#e5e7eb\\]{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#2383e224\\]{background-color:#2383e224}#yoopta-editor .yoo-editor-bg-\\[\\#37352f14\\]{background-color:#37352f14}#yoopta-editor .yoo-editor-bg-\\[\\#FFF\\]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-\\[\\#eee\\]{--tw-bg-opacity:1;background-color:rgb(238 238 238/var(--tw-bg-opacity))}#yoopta-editor .yoo-editor-bg-inherit{background-color:inherit}#yoopta-editor .yoo-editor-bg-transparent{background-color:transparent}#yoopta-editor .yoo-editor-p-0{padding:0}#yoopta-editor .yoo-editor-p-\\[0_4px\\]{padding:0 4px}#yoopta-editor .yoo-editor-px-0{padding-left:0;padding-right:0}#yoopta-editor .yoo-editor-px-2{padding-left:.5rem;padding-right:.5rem}#yoopta-editor .yoo-editor-px-\\[2px\\]{padding-left:2px;padding-right:2px}#yoopta-editor .yoo-editor-py-0{padding-bottom:0;padding-top:0}#yoopta-editor .yoo-editor-py-1{padding-bottom:.25rem;padding-top:.25rem}#yoopta-editor .yoo-editor-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}#yoopta-editor .yoo-editor-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}#yoopta-editor .yoo-editor-text-sm{font-size:.875rem;line-height:1.25rem}#yoopta-editor .yoo-editor-leading-\\[120\\%\\]{line-height:120%}#yoopta-editor .yoo-editor-text-\\[rgba\\(55\\,53\\,47\\,0\\.35\\)\\]{color:rgba(55,53,47,.35)}#yoopta-editor .yoo-editor-opacity-0{opacity:0}#yoopta-editor .yoo-editor-opacity-100{opacity:1}#yoopta-editor .yoo-editor-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}#yoopta-editor .yoo-editor-outline-none{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .yoo-editor-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-duration-150{transition-duration:.15s}#yoopta-editor .yoo-editor-duration-\\[180ms\\]{transition-duration:.18s}#yoopta-editor .yoo-editor-ease-\\[cubic-bezier\\(0\\.4\\,0\\,0\\.2\\,1\\)\\]{transition-timing-function:cubic-bezier(.4,0,.2,1)}#yoopta-editor .yoo-editor-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}#yoopta-editor *,#yoopta-editor :after,#yoopta-editor :before{box-sizing:border-box}#yoopta-editor button{background-color:transparent;border:none;cursor:pointer}#yoopta-editor blockquote,#yoopta-editor dd,#yoopta-editor dl,#yoopta-editor figure,#yoopta-editor h1,#yoopta-editor h2,#yoopta-editor h3,#yoopta-editor h4,#yoopta-editor h5,#yoopta-editor h6,#yoopta-editor hr,#yoopta-editor p,#yoopta-editor pre{margin:0}#yoopta-editor ::-moz-selection{background:#c6ddf8}#yoopta-editor ::selection{background:#c6ddf8}#yoopta-editor #yoopta-editor{height:auto;min-width:400px}#yoopta-editor .yoopta-placeholder:after{color:inherit;content:attr(data-placeholder);font-size:75%;font-style:inherit;font-weight:inherit;opacity:.5;padding-left:5px;position:absolute;text-indent:2px;top:50%;transform:translateY(-50%);-webkit-user-select:none;-moz-user-select:none;user-select:none}#yoopta-editor .hover\\:yoo-editor-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}#yoopta-editor .focus\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:focus,#yoopta-editor .hover\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:hover{background-color:rgba(55,54,47,.08)}#yoopta-editor .focus\\:yoo-editor-outline-none:focus{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .focus-visible\\:yoo-editor-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}#yoopta-editor .active\\:yoo-editor-bg-\\[rgba\\(55\\2c 54\\2c 47\\2c 0\\.08\\)\\]:active{background-color:rgba(55,54,47,.08)}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-pointer-events-none[data-disabled]{pointer-events:none}#yoopta-editor .data-\\[disabled\\]\\:yoo-editor-opacity-50[data-disabled]{opacity:.5}#yoopta-editor .data-\\[hovered-state-open\\=\\"true\\"\\]\\:yoo-editor-opacity-100[data-hovered-state-open=true]{opacity:1}');export{Mi as HOTKEYS,vl as UI,L as YooptaPlugin,Q as buildBlockData,J as buildBlockElement,Cl as createYooptaEditor,cl as createYooptaMark,gl as default,N as findPluginBlockBySelectionPath,ml as findPluginBlockByType,No as findSlateBySelectionPath,G as generateId,ii as getRootBlockElement,ri as getRootBlockElementType,H as useBlockData,Y as useBlockSelected,U as useYooptaBlock,z as useYooptaEditor,V as useYooptaPlugin,W as useYooptaPluginOptions,K as useYooptaReadOnly,ci as useYooptaTools};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/editor",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
@@ -67,5 +67,5 @@
67
67
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
68
68
  },
69
69
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
70
- "gitHead": "fb3d4ab03c9b43feb2258d8cb1dcd5959bf726ca"
70
+ "gitHead": "c01b4b4768cdd5fa190ae400f11e37f9375e98fc"
71
71
  }