@firecms/collection_editor 3.0.0-alpha.9 → 3.0.0-beta.2-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigControllerProvider.d.ts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.es.js +3128 -4094
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +22 -7
- package/dist/types/collection_inference.d.ts +1 -1
- package/dist/types/config_controller.d.ts +32 -5
- package/dist/types/persisted_collection.d.ts +3 -1
- package/dist/ui/CollectionViewHeaderAction.d.ts +10 -0
- package/dist/{components → ui}/EditorCollectionAction.d.ts +1 -1
- package/dist/ui/MissingReferenceWidget.d.ts +3 -0
- package/dist/ui/NewCollectionButton.d.ts +1 -0
- package/dist/ui/PropertyAddColumnComponent.d.ts +6 -0
- package/dist/ui/RootCollectionSuggestions.d.ts +1 -0
- package/dist/{components → ui}/collection_editor/CollectionDetailsForm.d.ts +3 -2
- package/dist/{components → ui}/collection_editor/CollectionEditorDialog.d.ts +11 -6
- package/dist/{components → ui}/collection_editor/CollectionPropertiesEditorForm.d.ts +6 -3
- package/dist/{components → ui}/collection_editor/CollectionYupValidation.d.ts +3 -0
- package/dist/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
- package/dist/ui/collection_editor/GetCodeDialog.d.ts +5 -0
- package/dist/{components → ui}/collection_editor/PropertyEditView.d.ts +8 -6
- package/dist/{components → ui}/collection_editor/PropertyFieldPreview.d.ts +4 -3
- package/dist/ui/collection_editor/PropertySelectItem.d.ts +8 -0
- package/dist/{components → ui}/collection_editor/PropertyTree.d.ts +8 -5
- package/dist/{components → ui}/collection_editor/SubcollectionsEditTab.d.ts +2 -2
- package/dist/{components → ui}/collection_editor/import/CollectionEditorImportDataPreview.d.ts +1 -1
- package/dist/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +7 -0
- package/dist/{components → ui}/collection_editor/import/clean_import_data.d.ts +1 -1
- package/dist/{components → ui}/collection_editor/properties/BlockPropertyField.d.ts +4 -1
- package/dist/{components → ui}/collection_editor/properties/CommonPropertyFields.d.ts +1 -0
- package/dist/{components → ui}/collection_editor/properties/MapPropertyField.d.ts +4 -1
- package/dist/{components → ui}/collection_editor/properties/RepeatPropertyField.d.ts +4 -1
- package/dist/{components → ui}/collection_editor/properties/StringPropertyField.d.ts +1 -1
- package/dist/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
- package/dist/ui/collection_editor/templates/blog_template.d.ts +2 -0
- package/dist/ui/collection_editor/templates/pages_template.d.ts +2 -0
- package/dist/ui/collection_editor/templates/products_template.d.ts +2 -0
- package/dist/ui/collection_editor/templates/users_template.d.ts +2 -0
- package/dist/ui/collection_editor/utils/strings.d.ts +1 -0
- package/dist/ui/collection_editor/utils/supported_fields.d.ts +3 -0
- package/dist/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
- package/dist/useCollectionEditorPlugin.d.ts +5 -3
- package/dist/utils/entities.d.ts +3 -4
- package/package.json +22 -19
- package/src/ConfigControllerProvider.tsx +336 -0
- package/src/index.ts +35 -0
- package/src/types/collection_editor_controller.tsx +42 -0
- package/src/types/collection_inference.ts +3 -0
- package/src/types/config_controller.tsx +60 -0
- package/src/types/config_permissions.ts +20 -0
- package/src/types/persisted_collection.ts +9 -0
- package/src/ui/CollectionViewHeaderAction.tsx +43 -0
- package/src/ui/EditorCollectionAction.tsx +109 -0
- package/src/ui/HomePageEditorCollectionAction.tsx +84 -0
- package/src/ui/MissingReferenceWidget.tsx +35 -0
- package/src/ui/NewCollectionButton.tsx +16 -0
- package/src/ui/NewCollectionCard.tsx +47 -0
- package/src/ui/PropertyAddColumnComponent.tsx +42 -0
- package/src/ui/RootCollectionSuggestions.tsx +55 -0
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +366 -0
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +754 -0
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +206 -0
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +481 -0
- package/src/ui/collection_editor/CollectionYupValidation.tsx +7 -0
- package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +37 -0
- package/src/ui/collection_editor/EnumForm.tsx +354 -0
- package/src/ui/collection_editor/GetCodeDialog.tsx +110 -0
- package/src/ui/collection_editor/PropertyEditView.tsx +558 -0
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +203 -0
- package/src/ui/collection_editor/PropertySelectItem.tsx +32 -0
- package/src/ui/collection_editor/PropertyTree.tsx +233 -0
- package/src/ui/collection_editor/SubcollectionsEditTab.tsx +253 -0
- package/src/ui/collection_editor/UnsavedChangesDialog.tsx +47 -0
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +37 -0
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +260 -0
- package/src/ui/collection_editor/import/clean_import_data.ts +53 -0
- package/src/ui/collection_editor/properties/BlockPropertyField.tsx +135 -0
- package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +36 -0
- package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +137 -0
- package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +87 -0
- package/src/ui/collection_editor/properties/EnumPropertyField.tsx +117 -0
- package/src/ui/collection_editor/properties/FieldHelperView.tsx +13 -0
- package/src/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +149 -0
- package/src/ui/collection_editor/properties/NumberPropertyField.tsx +38 -0
- package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +165 -0
- package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +108 -0
- package/src/ui/collection_editor/properties/StoragePropertyField.tsx +194 -0
- package/src/ui/collection_editor/properties/StringPropertyField.tsx +79 -0
- package/src/ui/collection_editor/properties/UrlPropertyField.tsx +89 -0
- package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +36 -0
- package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
- package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +50 -0
- package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +100 -0
- package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +132 -0
- package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
- package/src/ui/collection_editor/templates/blog_template.ts +115 -0
- package/src/ui/collection_editor/templates/pages_template.ts +188 -0
- package/src/ui/collection_editor/templates/products_template.ts +88 -0
- package/src/ui/collection_editor/templates/users_template.ts +42 -0
- package/src/ui/collection_editor/util.ts +21 -0
- package/src/ui/collection_editor/utils/strings.ts +8 -0
- package/src/ui/collection_editor/utils/supported_fields.tsx +29 -0
- package/src/ui/collection_editor/utils/update_property_for_widget.ts +271 -0
- package/src/ui/collection_editor/utils/useTraceUpdate.tsx +23 -0
- package/src/useCollectionEditorController.tsx +9 -0
- package/src/useCollectionEditorPlugin.tsx +137 -0
- package/src/useCollectionsConfigController.tsx +9 -0
- package/src/utils/arrays.ts +3 -0
- package/src/utils/entities.ts +38 -0
- package/src/vite-env.d.ts +1 -0
- package/dist/components/collection_editor/PropertySelectItem.d.ts +0 -8
- package/dist/components/collection_editor/SelectIcons.d.ts +0 -6
- package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +0 -4
- package/dist/components/collection_editor/templates/blog_template.d.ts +0 -10
- package/dist/components/collection_editor/templates/products_template.d.ts +0 -12
- package/dist/components/collection_editor/templates/users_template.d.ts +0 -7
- package/dist/components/collection_editor/utils/supported_fields.d.ts +0 -3
- package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +0 -3
- package/dist/types/editable_properties.d.ts +0 -10
- package/dist/utils/icons.d.ts +0 -2
- package/dist/utils/synonyms.d.ts +0 -1951
- /package/dist/{components → ui}/HomePageEditorCollectionAction.d.ts +0 -0
- /package/dist/{components → ui}/NewCollectionCard.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/CollectionEditorWelcomeView.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/EnumForm.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/UnsavedChangesDialog.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/BooleanPropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/DateTimePropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/EnumPropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/FieldHelperView.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/KeyValuePropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/NumberPropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/ReferencePropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/StoragePropertyField.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/validation/NumberPropertyValidation.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/validation/StringPropertyValidation.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/properties/validation/ValidationPanel.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/util.d.ts +0 -0
- /package/dist/{components → ui}/collection_editor/utils/useTraceUpdate.d.ts +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
(function(j,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@firecms/core"),require("react/jsx-runtime"),require("react-fast-compare"),require("formik"),require("yup"),require("flexsearch"),require("@firecms/schema_inference"),require("@hello-pangea/dnd"),require("@firecms/data_import"),require("react-router")):typeof define=="function"&&define.amd?define(["exports","react","@firecms/core","react/jsx-runtime","react-fast-compare","formik","yup","flexsearch","@firecms/schema_inference","@hello-pangea/dnd","@firecms/data_import","react-router"],g):(j=typeof globalThis<"u"?globalThis:j||self,g(j.FireCMS={},j.React,j.core,j.jsxRuntime,j.equal,j.formik,j.Yup,j.Index,j.schema_inference,j.dnd,j.data_import,j.reactRouter))})(this,function(j,g,t,e,ge,u,Je,Re,xe,Ce,te,et){"use strict";function ze(a){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const i in a)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(a,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>a[i]})}}return r.default=a,Object.freeze(r)}const X=ze(g),Te=ze(Je),tt=Te.object().shape({name:Te.string().required("Required"),path:Te.string().required("Required")}),Pe={abc:"alphabet character font letter symbol text type",access_alarm:"clock time",access_alarms:"clock time",accessibility:"accessible body handicap help human people person user",accessibility_new:"accessible arms body handicap help human people person user",accessible:"accessibility body handicap help human people person user wheelchair",accessible_forward:"accessibility body handicap help human people person wheelchair",access_time:"clock time",account_balance:"bank bill building card cash coin commerce court credit currency dollars finance money online payment structure temple transaction",account_balance_wallet:"bank bill card cash coin commerce credit currency dollars finance money online payment transaction",account_box:"avatar face human people person profile square thumbnail user",account_circle:"avatar face human people person profile thumbnail user",account_tree:"analytics chart connect data diagram flow infographic measure metrics process project sitemap square statistics structure tracking",ac_unit:"air cold conditioner freeze snowflake temperature weather winter",adb:"android bridge debug",add:"+ create item new plus symbol",add_alarm:"clock plus time",add_alert:"+ active alarm announcement bell callout chime information new notifications notify plus reminder ring sound symbol",add_a_photo:"+ camera lens new photography picture plus symbol",add_box:"create new plus square symbol",add_business:"+ bill building card cash coin commerce company credit currency dollars market money new online payment plus retail shopping storefront symbol",add_card:"+ bill cash coin commerce cost credit currency dollars finance money new online payment plus price shopping symbol",add_chart:"+ analytics bars data diagram infographic measure metrics new plus statistics symbol tracking",add_circle:"+ create new plus",add_circle_outline:"+ create new plus",add_comment:"+ bubble chat communicate feedback message new plus speech symbol",add_ic_call:"+ cell contact device hardware mobile new plus symbol telephone",add_link:"attach clip new plus symbol",add_location:"+ destination direction gps maps new pin place plus stop symbol",add_location_alt:"+ destination direction maps new pin place plus stop symbol",add_moderator:"+ certified new plus privacy private protection security shield symbol verified",add_photo_alternate:"+ image landscape mountains new photography picture plus symbol",add_road:"+ destination direction highway maps new plus stop street symbol traffic",add_shopping_cart:"card cash checkout coin commerce credit currency dollars money online payment plus",add_task:"+ approve check circle completed increase mark ok plus select tick yes",add_to_drive:"+ app backup cloud data files folders gdrive google plus recovery storage",add_to_home_screen:"Android add arrow cell device hardware iOS mobile phone tablet to up",add_to_photos:"collection image landscape mountains photography picture plus",add_to_queue:"+ Android backlog chrome desktop device display hardware iOS lineup mac monitor new plus screen symbol television watch web window",adf_scanner:"document feeder machine office",adjust:"alter center circles control dot edit filter fix image mix move setting slider sort switch target tune",admin_panel_settings:"account avatar certified face human people person privacy private profile protection security shield user verified",ad_units:"Android banner cell device hardware iOS mobile notifications phone tablet top",agriculture:"automobile cars cultivation farm harvest maps tractor transport travel truck vehicle",air:"blowing breeze flow wave weather wind",airlines:"airplane airport flight transportation travel trip",airline_seat_flat:"bed body business class first human people person rest sleep travel",airline_seat_flat_angled:"bed body business class first human people person rest sleep travel",airline_seat_individual_suite:"bed body business class first human people person rest sleep travel",airline_seat_legroom_extra:"body feet human people person sitting space travel",airline_seat_legroom_normal:"body feet human people person sitting space travel",airline_seat_legroom_reduced:"body feet human people person sitting space travel",airline_seat_recline_extra:"body feet human legroom people person sitting space travel",airline_seat_recline_normal:"body extra feet human legroom people person sitting space travel",airline_stops:"arrow destination direction layover location maps place transportation travel trip",airplanemode_active:"flight flying on signal",airplanemode_inactive:"airport disabled enabled flight flying maps offline slash transportation travel",airplane_ticket:"airport boarding flight fly maps pass transportation travel",airplay:"apple arrow cast connect control desktop device display monitor screen signal television tv",airport_shuttle:"automobile bus cars commercial delivery direction maps mini public transportation travel truck van vehicle",alarm:"alart bell clock countdown date notification schedule time",alarm_add:"+ alart bell clock countdown date new notification plus schedule symbol time",alarm_off:"alart bell clock disabled duration enabled notification slash stop timer watch",alarm_on:"alart bell checkmark clock disabled duration enabled notification off ready slash start timer watch",album:"artist audio bvb cd computer data disk file music play record sound storage track vinyl",align_horizontal_center:"alignment format layout lines paragraph rules style text",align_horizontal_left:"alignment format layout lines paragraph rules style text",align_horizontal_right:"alignment format layout lines paragraph rules style text",align_vertical_bottom:"alignment format layout lines paragraph rules style text",align_vertical_center:"alignment format layout lines paragraph rules style text",align_vertical_top:"alignment format layout lines paragraph rules style text",all_inbox:"Inbox delivered delivery email letter message post send",all_inclusive:"endless forever infinite infinity loop mobius neverending strip sustainability sustainable",all_out:"arrows circle directional expand shape",alternate_email:"@ address contact tag",alt_route:"alternate alternative arrows direction maps navigation options other routes split symbol",analytics:"assessment bar chart data diagram infographic measure metrics statistics tracking",anchor:"google logo",android:"brand character logo mascot operating system toy",animation:"circles film motion movement movie moving sequence video",announcement:"! alert attention balloon bubble caution chat comment communicate danger error exclamation feedback important mark message news notification speech symbol warning",aod:"Android always device display hardware homescreen iOS mobile phone tablet",apartment:"accommodation architecture building city company estate flat home house office places real residence residential shelter units workplace",api:"developer development enterprise software",app_blocking:"Android applications cancel cell device hardware iOS mobile phone stopped tablet",apple:"brand logo",app_registration:"apps edit pencil register",approval:"apply approvals approve certificate certification disapproval drive file impression ink mark postage stamp",apps:"all applications circles collection components dots grid homescreen icons interface squares ui ux",app_settings_alt:"Android applications cell device gear hardware iOS mobile phone tablet",app_shortcut:"bookmarked favorite highlight important mobile saved software special star",apps_outage:"all applications circles collection components dots grid interface squares ui ux",architecture:"art compass design drawing engineering geometric tool",archive:"inbox mail store",arrow_back:"application components direction interface left navigation previous screen ui ux website",arrow_back_ios:"application chevron components direction interface left navigation previous screen ui ux website",arrow_back_ios_new:"application chevron components direction interface left navigation previous screen ui ux website",arrow_circle_down:"direction navigation",arrow_circle_up:"direction navigation",arrow_downward:"application components direction interface navigation screen ui ux website",arrow_drop_down:"application components direction interface navigation screen ui ux website",arrow_drop_down_circle:"application components direction interface navigation screen ui ux website",arrow_drop_up:"application components direction interface navigation screen ui ux website",arrow_forward:"application arrows components direction interface navigation right screen ui ux website",arrow_forward_ios:"application chevron components direction interface navigation next right screen ui ux website",arrow_left:"application backstack backward components direction interface navigation previous screen ui ux website",arrow_right:"application components continue direction forward interface navigation screen ui ux website",arrow_right_alt:"arrows direction east navigation pointing shape",arrow_upward:"application components direction interface navigation screen submit ui ux website",article:"clarify document file news page paper text writing",art_track:"album artist audio display format image insert music photography picture sound tracks",aspect_ratio:"expand image monitor resize resolution scale screen square",assessment:"analytics bars chart data diagram infographic measure metrics report statistics tracking",assignment:"article clipboard document task text writing",assignment_ind:"account clipboard document face people person profile task user",assignment_late:"! alert announcement attention caution clipboard danger document error exclamation important mark notification symbol task warning",assignment_return:"arrow back clipboard document left point retun task",assignment_returned:"arrow clipboard document down point task",assignment_turned_in:"approve checkmark clipboard complete document done finished ok select task tick validate verified yes",assistant:"bubble chat comment communicate feedback message recommendation speech star suggestion twinkle",assistant_direction:"destination location maps navigate navigation pin place right stop",assistant_photo:"flag recommendation smart star suggestion",assured_workload:"compliance confidential federal government regulatory secure sensitive",atm:"alphabet automated bill card cart cash character coin commerce credit currency dollars font letter machine money online payment shopping symbol teller text type",attach_email:"attachment clip compose envelop letter link message send",attach_file:"add item link mail media paperclip",attachment:"compose file image item link paperclip",attach_money:"bill card cash coin commerce cost credit currency dollars finance online payment price profit sale symbol",attractions:"amusement entertainment ferris fun maps park places wheel",attribution:"attribute body copyright copywriter human people person",audio_file:"document key music note sound track",audiotrack:"key music note sound",auto_awesome:"adjust editing enhance filter image photography photos setting stars",auto_awesome_mosaic:"adjust collage editing enhance filter grid image layout photographs photography photos pictures setting",auto_awesome_motion:"adjust animation collage editing enhance filter image live photographs photography photos pictures setting video",auto_delete:"bin can clock date garbage remove schedule time trash",auto_fix_high:"adjust editing enhance erase magic modify pen stars tool wand",auto_fix_normal:"edit erase magic modify stars wand",auto_fix_off:"disabled edit enabled erase magic modify on slash stars wand",autofps_select:"A alphabet character font frame frequency letter per rate seconds symbol text type",auto_graph:"analytics chart data diagram infographic line measure metrics stars statistics tracking",auto_mode:"around arrows direction inprogress loading navigation nest refresh renew rotate turn",autorenew:"around arrows cached direction inprogress loader loading navigation pending refresh rotate status turn",auto_stories:"audiobook flipping pages reading story",av_timer:"clock countdown duration minutes seconds stopwatch",baby_changing_station:"babies bathroom body children father human infant kids mother newborn people person toddler wc young",backpack:"bookbag knapsack storage travel",backspace:"arrow cancel clear correct delete erase remove",backup:"arrow cloud data drive files folders point storage submit upload",backup_table:"drive files folders format layout stack storage",badge:"account avatar card certified employee face human identification name people person profile security user work",bakery_dining:"bread breakfast brunch croissant food",balance:"equal equilibrium equity impartiality justice parity stability. steadiness symmetry",balcony:"architecture doors estate home house maps outside place real residence residential stay terrace window",ballot:"bullet bulllet election list point poll vote",bar_chart:"analytics anlytics data diagram infographic measure metrics statistics tracking",batch_prediction:"bulb idea light",bathroom:"closet home house place plumbing shower sprinkler wash water wc",bathtub:"bathing bathroom clean home hotel human person shower travel",battery_alert:"! attention caution cell charge danger error exclamation important mark mobile notification power symbol warning",battery_charging_full:"cell charge lightening lightning mobile power thunderbolt",battery_full:"cell charge mobile power",battery_saver:"+ add charge charging new plus power symbol",battery_std:"cell charge mobile plus power standard",battery_unknown:"? assistance cell charge help information mark mobile power punctuation question support symbol",beach_access:"parasol places summer sunny umbrella",bed:"bedroom double full furniture home hotel house king night pillows queen rest size sleep",bedroom_baby:"babies children home horse house infant kid newborn rocking toddler young",bedroom_child:"children furniture home hotel house kid night pillows rest size sleep twin young",bedroom_parent:"double full furniture home hotel house king master night pillows queen rest sizem sleep",bedtime:"nightime sleep",bedtime_off:"nightime sleep",beenhere:"approve archive bookmark checkmark complete done favorite label library reading remember ribbon save select tag tick validate verified yes",bento:"box dinner food lunch meal restaurant takeout",bike_scooter:"automobile cars maps transportation vehicle vespa",biotech:"chemistry laboratory microscope research science technology test",blender:"appliance cooking electric juicer kitchen machine vitamix",blinds_closed:"cover curtains nest shutter sunshade",block:"allowed avoid banned cancel close disable entry exit not prohibited quit remove stop",bloodtype:"donate droplet emergency hospital medicine negative positive water",bluetooth:"cast connection device network paring streaming symbol wireless",bluetooth_audio:"connection device music signal sound symbol",bluetooth_connected:"cast connection device network paring streaming symbol wireless",bluetooth_disabled:"cast connection device enabled network offline paring slash streaming symbol wireless",bluetooth_drive:"automobile cars cast connection device maps paring streaming symbol transportation travel vehicle wireless",bluetooth_searching:"connection device network paring symbol wireless",blur_circular:"circle dots editing effect enhance filter",blur_linear:"dots editing effect enhance filter",blur_off:"disabled dots editing effect enabled enhance on slash",blur_on:"disabled dots editing effect enabled enhance filter off slash",bolt:"electric energy fast flash lightning power thunderbolt",book:"blog bookmark favorite label library reading remember ribbon save tag",bookmark:"archive favorite follow label library reading remember ribbon save tag",bookmark_add:"+ favorite plus remember ribbon save symbol",bookmark_added:"approve check complete done favorite remember save select tick validate verified yes",bookmark_border:"archive favorite label library outline reading remember ribbon save tag",bookmark_remove:"delete favorite minus remember ribbon save subtract",bookmarks:"favorite label layers library multiple reading remember ribbon save stack tag",book_online:"Android admission appointment cell device event hardware iOS mobile pass phone reservation tablet ticket",border_all:"doc editing editor spreadsheet stroke text type writing",border_bottom:"doc editing editor spreadsheet stroke text type writing",border_clear:"doc editing editor spreadsheet stroke text type writing",border_color:"all create doc editing editor marker pencil spreadsheet stroke text type writing",border_horizontal:"doc editing editor spreadsheet stroke text type writing",border_inner:"doc editing editor spreadsheet stroke text type writing",border_left:"doc editing editor spreadsheet stroke text type writing",border_outer:"doc editing editor spreadsheet stroke text type writing",border_right:"doc editing editor spreadsheet stroke text type writing",border_style:"color doc editing editor spreadsheet stroke text type writing",border_top:"doc editing editor spreadsheet stroke text type writing",border_vertical:"doc editing editor spreadsheet stroke text type writing",boy:"body gender human male people person social symbol",branding_watermark:"components copyright design emblem format identity interface layout logo screen stamp ui ux website window",breakfast_dining:"bakery bread butter food toast",brightness_1:"circle control crescent cresent level moon screen",brightness_2:"circle control crescent cresent level moon night screen",brightness_3:"circle control crescent cresent level moon night screen",brightness_4:"circle control crescent cresent dark level moon night screen sun",brightness_5:"circle control crescent cresent level moon screen sun",brightness_6:"circle control crescent cresent level moon screen sun",brightness_7:"circle control crescent cresent level light moon screen sun",brightness_auto:"A control display level mobile monitor phone screen",brightness_high:"auto control mobile monitor phone",brightness_low:"auto control mobile monitor phone",brightness_medium:"auto control mobile monitor phone",broken_image:"corrupt error landscape mountains photography picture torn",browser_not_supported:"disabled enabled internet off on page screen slash website www",browser_updated:"Android arrow chrome desktop device display download hardware iOS mac monitor screen web window",brunch_dining:"breakfast champagne champaign drink food lunch meal",brush:"art design draw editing painting tool",bubble_chart:"analytics bars data diagram infographic measure metrics statistics tracking",bug_report:"animal file fix insect issue problem testing ticket virus warning",build:"adjust fix repair spanner tool wrench",build_circle:"adjust fix repair tool wrench",bungalow:"architecture cottage estate home house maps place real residence residential stay traveling",burst_mode:"image landscape mountains multiple photography picture",bus_alert:"! attention automobile cars caution danger error exclamation important maps mark notification symbol transportation vehicle warning",business:"address apartment architecture building company estate flat home office place real residence residential shelter structure",business_center:"baggage briefcase places purse suitcase work",cabin:"architecture camping cottage estate home house log maps place real residence residential stay traveling wood",cable:"connection device electronics usb wire",cached:"around arrows inprogress loader loading refresh reload renew rotate",cake:"baked birthday candles celebration dessert food frosting party pastries pastry pie social sweet",calculate:"+ - = calculator count finance math",calendar_today:"date event month remember reminder schedule week",calendar_view_day:"date event format grid layout month remember reminder schedule today week",calendar_view_month:"date event format grid layout schedule today",calendar_view_week:"date event format grid layout month schedule today",call:"cell contact device hardware mobile talk telephone",call_end:"cell contact device hardware mobile talk telephone",call_made:"arrow device mobile",call_merge:"arrow device mobile",call_missed:"arrow device mobile",call_missed_outgoing:"arrow device mobile",call_received:"arrow device mobile",call_split:"arrow device mobile",call_to_action:"alert bar components cta design information interface layout message notification screen ui ux website window",camera:"album aperture lens photography picture record screenshot shutter",camera_alt:"image photography picture",camera_enhance:"important lens photography picture quality special star",camera_front:"body human lens mobile person phone photography portrait selfie",camera_indoor:"architecture building estate filming home house image inside motion nest picture place real residence residential shelter videography",camera_outdoor:"architecture building estate filming home house image motion nest outside picture place real residence residential shelter videography",camera_rear:"front lens mobile phone photography picture portrait selfie",camera_roll:"film image library photography",cameraswitch:"arrows flip rotate swap view",campaign:"alert announcement loud megaphone microphone notification speaker",cancel:"circle close cross disable exit status stop",cancel_presentation:"close device exit no quit remove screen share slide stop website window",cancel_schedule_send:"email no quit remove share stop x",candlestick_chart:"analytics data diagram finance infographic measure metrics statistics tracking",card_giftcard:"account balance bill cart cash certificate coin commerce creditcard currency dollars money online payment present shopping",card_membership:"bill bookmark cash certificate coin commerce cost creditcard currency dollars finance loyalty money online payment shopping subscription",card_travel:"bill cash coin commerce cost creditcard currency dollars finance membership miles money online payment trip",carpenter:"building construction cutting handyman repair saw tool",car_rental:"automobile cars key maps transportation vehicle",car_repair:"automobile cars maps transportation vehicle",cases:"baggage briefcase business purse suitcase",casino:"dice dots entertainment gamble gambling games luck places",cast:"Android airplay chromecast connect desktop device display hardware iOS mac monitor screencast streaming television tv web window wireless",cast_connected:"Android airplay chromecast desktop device display hardware iOS mac monitor screencast streaming television tv web window wireless",cast_for_education:"Android airplay chrome connect desktop device display hardware iOS learning lessons mac monitor screencast streaming teaching television tv web window wireless",catching_pokemon:"go pokestop travel",category:"categories circle collection items product sort square triangle",celebration:"activity birthday event fun party",cell_tower:"broadcast casting network signal transmitting wireless",cell_wifi:"connection data internet mobile network phone service signal wireless",center_focus_strong:"camera image lens photography zoom",center_focus_weak:"camera image lens photography zoom",chair:"comfort couch decoration furniture home house living lounging loveseat room seating sofa",chair_alt:"cahir furniture home house kitchen lounging seating table",chalet:"architecture cottage estate home house maps place real residence residential stay traveling",change_circle:"around arrows direction navigation rotate",change_history:"shape triangle",charging_station:"Android battery cell device electric hardware iOS lightning mobile phone tablet thunderbolt",chat:"bubble comment communicate feedback message speech talk text",chat_bubble:"comment communicate feedback message speech talk text",chat_bubble_outline:"comment communicate feedback message speech talk text",check:"checkmark complete confirm correct done enter okay purchased select success tick yes",check_box:"approved button checkmark component control form ok selected selection square success tick toggle ui yes",check_box_outline_blank:"button checkmark component control deselected empty form selection square tick toggle ui",check_circle:"approve checkmark complete done download finished ok select success tick upload validate verified yes",check_circle_outline:"approve checkmark complete done finished ok select success tick validate verified yes",checkroom:"check closet clothes coat hanger",chevron_left:"arrows back direction triangle",chevron_right:"arrows direction forward triangle",child_care:"babies baby children face infant kids newborn toddler young",child_friendly:"baby care carriage children infant kid newborn stroller toddler young",chrome_reader_mode:"text",circle:"bullet button dot full geometry moon period radio",circle_notifications:"active alarm alert bell chime notify reminder ring sound",class:"archive bookmark category favorite item label library reading remember ribbon save tag",clean_hands:"bacteria disinfect germs gesture sanitizer",cleaning_services:"dust sweep",clear:"allowed back cancel correct cross delete disable erase exit not times",clear_all:"delete document erase format lines list notifications wipe",close:"allowed cancel cross disable exit not status stop times",closed_caption:"accessible alphabet character decoder font language letter media movies subtitles symbol text tv type",closed_caption_disabled:"accessible alphabet character decoder enabled font language letter media movies off slash subtitles symbol text tv type",closed_caption_off:"accessible alphabet character decoder font language letter media movies outline subtitles symbol text tv type",close_fullscreen:"action arrows collapse direction minimize",cloud:"connection internet network sky upload weather",cloud_circle:"application backup connection drive files folders internet network sky storage upload",cloud_done:"application approve backup checkmark complete connection drive files folders internet network ok select sky storage tick upload validate verified yes",cloud_download:"application arrow backup connection drive files folders internet network sky storage upload",cloud_off:"application backup connection disabled drive enabled files folders internet network offline sky slash storage upload",cloud_queue:"connection internet network sky upload",cloud_sync:"application around backup connection drive files folders inprogress internet loading network refresh renew rotate sky storage turn upload",cloud_upload:"application arrow backup connection download drive files folders internet network sky storage",co2:"carbon dioxide gas",code:"brackets css developer engineering html parenthesis platform",code_off:"brackets css developer disabled enabled engineering html on platform slash",coffee:"beverage cup drink mug plate set tea",coffee_maker:"appliances beverage cup drink machine mug",collections:"album gallery image landscape library mountains photography picture stack",collections_bookmark:"album archive favorite gallery label library reading remember ribbon save stack tag",colorize:"color dropper extract eye picker pipette tool",color_lens:"art paint pallet",comment:"bubble chat communicate document feedback message note outline speech",comment_bank:"archive bookmark bubble cchat communicate favorite label library message remember ribbon save speech tag",comments_disabled:"bubble chat communicate enabled feedback message offline on slash speech",commit:"accomplish bind circle dedicate execute line perform pledge",commute:"automobile car direction maps public train transportation trip vehicle",compare:"adjustment editing edits enhance fix images photography photos scan settings",compare_arrows:"collide directional facing left pointing pressure push right together",compass_calibration:"connection internet location maps network refresh service signal wifi wireless",compress:"arrows collide pressure push together",computer:"Android chrome desktop device hardware iOS laptop mac monitor pc web window",confirmation_number:"admission entertainment event ticket",connected_tv:"Android airplay chrome desktop device display hardware iOS mac monitor screencast streaming television web window wireless",connecting_airports:"airplanes flight transportation travel trip",connect_without_contact:"communicating distance people signal socialize",construction:"build carpenter equipment fix hammer improvement industrial industry repair tools wrench",contactless:"applepay bluetooth cash connection connectivity credit device finance payment signal tap transaction wifi wireless",contact_mail:"account address avatar communicate email face human information message people person profile user",contact_page:"account avatar data document drive face folders human people person profile sheet slide storage user writing",contact_phone:"account avatar call communicate face human information message mobile number people person profile user",contacts:"account address avatar call cell face human information mobile number people person phone profile user",contact_support:"? alert announcement bubble chat comment communicate help information mark message punctuation speech symbol vquestion",content_copy:"cut document duplicate file multiple past",content_cut:"copy document file past scissors trim",content_paste:"clipboard copy cut document file multiple",content_paste_go:"clipboard disabled document enabled file slash",content_paste_off:"clipboard disabled document enabled file slash",content_paste_search:"clipboard document file find trace track",contrast:"black editing effect filter grayscale images photography pictures settings white",control_camera:"adjust arrows center direction left move right",control_point:"+ add circle plus",control_point_duplicate:"+ add circle multiple new plus symbol",co_present:"arrow co-present presentation screen share slides togather website",copy_all:"content cut document file multiple page paper past",copyright:"alphabet character circle emblem font legal letter owner symbol text",coronavirus:"19 bacteria covid disease germs illness sick social",corporate_fare:"architecture building business estate organization place real residence residential shelter",cottage:"architecture beach estate home house lake lodge maps place real residence residential stay traveling",countertops:"home house kitchen sink table",create:"compose editing input item new pencil write writing",create_new_folder:"+ add data directory document drive file plus sheet slide storage symbol",credit_card:"bill cash charge coin commerce cost creditcard currency dollars finance information money online payment price shopping symbol",credit_card_off:"charge commerce cost disabled enabled finance money online payment slash",credit_score:"approve bill card cash check coin commerce complete cost currency dollars done finance loan mark money ok online payment select symbol tick validate verified yes",crib:"babies baby bassinet bed children cradle infant kid newborn sleeping toddler",crop:"adjustments area editing frame images photos rectangle settings size square",crop_169:"adjustments area by editing frame images photos picture rectangle settings size square",crop_32:"adjustments area by editing frame images photos picture rectangle settings size square",crop_54:"adjustments area by editing frame images photos picture rectangle settings size square",crop_75:"adjustments area by editing frame images photos picture rectangle settings size square",crop_din:"adjustments area editing frame images photos picture rectangle settings size square",crop_free:"adjustments barcode editing focus frame image photos qrcode settings size square zoom",crop_landscape:"adjustments area editing frame images photos picture settings size square",crop_original:"adjustments area editing frame images photos picture settings size square",crop_portrait:"adjustments area editing frame images photos picture rectangle settings size square",crop_rotate:"adjustments area arrows editing frame images photos settings size turn",crop_square:"adjustments area editing frame images photos rectangle settings size",css:"alphabet brackets character code developer engineering font html letter platform symbol text type",currency_exchange:"360 around arrows cash coin commerce direction dollars inprogress money pay renew rotate sync turn universal",currency_franc:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_lira:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_pound:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_ruble:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_rupee:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_yen:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",currency_yuan:"bill card cash coin commerce cost credit dollars finance money online payment price shopping symbol",curtains:"blinds cover nest open shutter sunshade",curtains_closed:"blinds cover nest shutter sunshade",dangerous:"broken fix no sign stop update warning wrong",dark_mode:"application device interface moon night silent theme ui ux website",dashboard:"cards format layout rectangle shapes square website",dashboard_customize:"cards format layout rectangle shapes square website",data_saver_off:"analytics bars chart diagram donut infographic measure metrics ring statistics tracking",data_saver_on:"+ add analytics chart diagram infographic measure metrics new plus ring statistics symbol tracking",data_thresholding:"hidden privacy thresold",data_usage:"analytics chart circle diagram infographic measure metrics statistics tracking",date_range:"agenda calendar event month remember reminder schedule time today week",deblur:"adjust editing enhance face image lines photography sharpen",deck:"chairs furniture garden home house outdoors outside patio social terrace umbrella yard",dehaze:"adjust editing enhance image lines photography remove",delete:"bin garbage junk recycle remove trashcan",delete_forever:"bin cancel exit garbage junk recycle remove trashcan",delete_outline:"bin can garbage remove trash",delete_sweep:"bin garbage junk recycle remove trashcan",delivery_dining:"food meal restaurant scooter takeout transportation vehicle vespa",density_large:"horizontal lines rules",density_medium:"horizontal lines rules",density_small:"horizontal lines rules",departure_board:"automobile bus cars clock maps public schedule time transportation travel vehicle",description:"article bill data document drive file folders invoice item notes page paper sheet slide text writing",desktop_access_disabled:"Android apple chrome device display enabled hardware iOS mac monitor offline pc screen slash web window",desktop_mac:"Android apple chrome device display hardware iOS monitor pc screen web window",desktop_windows:"Android chrome device display hardware iOS mac monitor pc screen television tv web",details:"editing enhance image photography sharpen triangle",developer_board:"computer development devkit hardware microchip processor",developer_board_off:"computer development disabled enabled hardware microchip on processor slash",developer_mode:"Android bracket cell code development device engineer hardware iOS mobile phone tablet",device_hub:"Android circle computer desktop hardware iOS laptop mobile monitor phone square tablet triangle watch wearable web",devices:"Android computer desktop hardware iOS laptop mobile monitor phone tablet watch wearable web",devices_other:"Android cell chrome desktop gadget hardware iOS ipad mac mobile monitor phone smartwatch tablet vr wearables window",device_thermostat:"celsius fahrenheit temperature thermometer",device_unknown:"? Android assistance cell hardware help iOS information mark mobile phone punctuation question support symbol tablet",dialer_sip:"alphabet call cell character contact device font hardware initiation internet letter mobile over protocol routing session symbol telephone text type voice",dialpad:"buttons call contact device dots mobile numbers phone",diamond:"fashion gems jewelry logo retail valuables",difference:"compare content copy cut document duplicate file multiple past",dining:"cafeteria cutlery diner eating fork room spoon",dinner_dining:"breakfast food fork lunch meal restaurant spaghetti utensils",directions:"arrow maps naviate right route sign traffic",directions_bike:"bicycle human maps person public route transportation",directions_boat:"automobile cars ferry maps public transportation vehicle",directions_boat_filled:"automobile cars ferry maps public transportation vehicle",directions_bus:"automobile cars maps public transportation vehicle",directions_bus_filled:"automobile cars maps public transportation vehicle",directions_car:"automobile cars maps public transportation vehicle",directions_car_filled:"automobile cars maps public transportation vehicle",directions_off:"arrow disabled enabled maps right route sign slash traffic",directions_railway:"automobile cars maps public train transportation vehicle",directions_railway_filled:"automobile cars maps public train transportation vehicle",directions_run:"body health human jogging maps people person route running walk",directions_subway:"automobile cars maps public rail train transportation vehicle",directions_subway_filled:"automobile cars maps public rail train transportation vehicle",directions_transit:"automobile cars maps metro public rail subway train transportation vehicle",directions_transit_filled:"automobile cars maps public rail subway train transportation vehicle",directions_walk:"body human jogging maps people person route run",dirty_lens:"camera photography picture splat",disabled_by_default:"box cancel close exit no quit remove square stop",disc_full:"! alert attention caution cd danger error exclamation important mark music notification storage symbol vinyl warning",display_settings:"Android application change chrome desktop details device gear hardware iOS information mac monitor options personal screen service web window",dns:"address bars domain information ip list lookup name network server system",dock:"Android cell charger charging connector device hardware iOS mobile phone power station tablet",document_scanner:"article data drive file folders notes page paper sheet slide text writing",do_disturb:"cancel close denied deny remove silence stop",do_disturb_alt:"cancel close denied deny remove silence stop",do_disturb_off:"cancel close denied deny disabled enabled on remove silence slash stop",do_disturb_on:"cancel close denied deny disabled enabled off remove silence slash stop",domain:"apartment architecture building business estate home place real residence residential shelter web www",domain_add:"+ apartment architecture building business estate home new place plus real residence residential shelter symbol web www",domain_disabled:"apartment architecture building business company enabled estate home internet maps office offline on place real residence residential slash website",domain_verification:"application approve check complete design desktop done interface internet layout mark ok screen select tick ui ux validate verified website window www yes",done:"approve checkmark complete finished ok select success tick validate verified yes",done_all:"approve checkmark complete finished layers multiple ok select stack success tick validate verified yes",done_outline:"all approve checkmark complete finished ok select success tick validate verified yes",do_not_disturb:"cancel close denied deny remove silence stop",do_not_disturb_alt:"cancel close denied deny remove silence stop",do_not_disturb_off:"cancel close denied deny disabled enabled on remove silence slash stop",do_not_disturb_on:"cancel close denied deny disabled enabled off remove silence slash stop",do_not_disturb_on_total_silence:"busy mute on quiet total",do_not_step:"boot disabled enabled feet foot off on shoe slash sneaker",do_not_touch:"disabled enabled fingers gesture hand off on slash",donut_large:"analytics chart circle complete data diagram infographic inprogress, measure metrics pie statistics tracking",donut_small:"analytics chart circle data diagram infographic inprogress measure metrics pie statistics tracking",door_back:"closed doorway entrance exit home house",doorbell:"alarm home house ringing",door_front:"closed doorway entrance exit home house",door_sliding:"automatic doorway double entrance exit glass home house two",double_arrow:"arrows chevron direction multiple navigation right",downhill_skiing:"athlete athletic body entertainment exercise hobby human people person ski snow social sports travel winter",download:"arrow downloads drive install upload",download_done:"arrows check downloads drive installed ok tick upload",download_for_offline:"arrow circle for install offline upload",downloading:"arrow circle downloads install pending progress upload",drafts:"document email envelope file letter message read",drag_handle:"application components design interface layout lines menu move screen ui ux website window",drag_indicator:"application circles components design dots drop interface layout mobile monitor move phone screen shape shift tablet ui ux website window",drive_eta:"automobile cars destination direction estimate maps public transportation travel trip vehicle",drive_file_move:"arrows data direction document folders right sheet side slide storage",drive_file_rename_outline:"compose create draft editing input pencil write writing",drive_folder_upload:"arrow data document file sheet slide storage",dry:"air bathroom dryer fingers gesture hand wc",dry_cleaning:"hanger hotel laundry places service towel",duo:"call chat conference device video",dvr:"Android audio chrome computer desktop device display electronic hardware iOS laptop list mac monitor recorder screen tv video web window",dynamic_feed:"layer live multiple post refresh update",dynamic_form:"code electric fast lightning lists questionnaire thunderbolt",earbuds:"accessory audio earphone headphone listen music sound",earbuds_battery:"accessory audio charging earphone headphone listen music sound",east:"arrow directional maps navigation right",edgesensor_high:"Android cell device hardware iOS mobile move phone sensitivity tablet vibrate",edgesensor_low:"Android cell device hardware iOS mobile move phone sensitivity tablet vibrate",edit:"compose create editing input new pencil write writing",edit_attributes:"approve attribution check complete done mark ok select tick validate verified yes",edit_location:"destination direction gps maps pencil pin place stop write",edit_location_alt:"pencil pin",edit_notifications:"active alarm alert bell chime compose create draft editing input new notify pencil reminder ring sound write writing",edit_off:"compose create disabled draft editing enabled input new offline on pencil slash write writing",edit_road:"destination direction highway maps pencil street traffic",egg:"breakfast brunch food",egg_alt:"breakfast brunch food",eighteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",eight_k:"8000 8K alphabet character digit display font letter number pixels resolution symbol text type video",eight_k_plus:"+ 7000 8K alphabet character digit display font letter number pixels resolution symbol text type video",eight_mp:"camera digit font image letters megapixels number quality resolution symbol text type",eightteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",eject:"arrow disc drive dvd player remove triangle up usb",elderly:"body cane human old people person senior",elderly_woman:"body cane female gender girl human lady old people person senior social symbol women",electrical_services:"charge cord plug power wire",electric_bike:"automobile cars electricity maps scooter transportation travel vehicle vespa",electric_bolt:"energy fast lightning nest thunderbolt",electric_car:"automobile cars electricity maps transportation travel vehicle",electric_meter:"energy fast lightning measure nest thunderbolt usage voltage volts",electric_moped:"automobile bike cars maps scooter transportation travel vehicle vespa",electric_rickshaw:"automobile cars india maps transportation truck vehicle",electric_scooter:"automobile bike cars maps transportation vehicle vespa",elevator:"body down human people person up",eleven_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",email:"envelope letter message note post receive send write",e_mobiledata:"alphabet font letter text type",emoji_emotions:"emoticon expressions face feelings glad happiness happy like mood person pleased smiley smiling social survey",emoji_events:"achievement award chalice champion cup first prize reward sport trophy winner",emoji_food_beverage:"coffee cup dring drink mug plate set tea",emoji_nature:"animal bee daisy flower honey insect ladybug petals spring summer",emoji_objects:"creative idea lamp lightbulb solution thinking",emoji_people:"arm body greeting human person social wave waving",emoji_symbols:"ampersand character hieroglyph music note percent sign",emoji_transportation:"architecture automobile building cars commute company direction estate maps office place public real residence residential shelter travel vehicle",energy_savings_leaf:"eco leaves nest usage",engineering:"body cogs cogwheel construction fixing gears hat helmet human maintenance people person setting worker",enhanced_encryption:"+ add locked new password plus privacy private protection safety secure security symbol",equalizer:"adjustment analytics chart data graph measure metrics music noise sound static statistics tracking volume",error:"! alert announcement attention caution circle danger exclamation feedback important mark notification problem symbol warning",error_outline:"! alert announcement attention caution circle danger exclamation feedback important mark notification problem symbol warning",escalator:"down staircase up",escalator_warning:"body child human kid parent people person",euro:"bill card cash coin commerce cost credit currency dollars euros finance money online payment price profit shopping symbol",euro_symbol:"bill card cash coin commerce cost credit currency dollars finance money online payment price profit",event:"agenda calendar date item mark month range remember reminder today week",event_available:"agenda approve calendar check complete done item mark ok schedule select tick time validate verified yes",event_busy:"agenda calendar cancel close date exit item no remove schedule stop time unavailable",event_note:"agenda calendar date item schedule text time writing",event_repeat:"around calendar date day inprogress loading month refresh renew rotate schedule turn",event_seat:"assigned bench chair furniture reservation row section sit",ev_station:"automobile cars charge charging electricity filling fuel gasoline maps places power station transportation vehicle",exit_to_app:"application arrow back components design export interface layout leave login logout mobile monitor move output phone pointing quit register right screen signin signout signup tablet ux website window",expand:"arrows compress enlarge grow move push together",expand_circle_down:"arrows chevron collapse direction expandable list more",expand_less:"arrows chevron collapse direction expandable list up",expand_more:"arrows chevron collapse direction down expandable list",explicit:"adult alphabet character content font language letter media movies music parent rating supervision symbol text type",explore:"compass destination direction east location maps needle north south travel west",explore_off:"compass destination direction disabled east enabled location maps needle north slash south travel west",exposure:"add brightness contrast editing effect image minus photography picture plus settings subtract",extension:"add-ons app extended game item jigsaw piece plugin puzzle shape",extension_off:"disabled enabled extended jigsaw piece puzzle shape slash",face:"account avatar emoji eyes human login logout people person profile recognition security social thumbnail unlock user",facebook:"brand logo social",face_retouching_natural:"editing effect emoji emotion faces image photography settings star tag",face_retouching_off:"disabled editing effect emoji emotion enabled faces image natural photography settings slash tag",fact_check:"approve complete done list mark ok select tick validate verified yes",factory:"industry manufacturing warehouse",family_restroom:"bathroom children father kids mother parents wc",fastfood:"drink hamburger maps meal places",fast_forward:"control ff media music play speed time tv video",fast_rewind:"back control media music play speed time tv video",favorite:"appreciate health heart like love remember save shape success",favorite_border:"health heart like love outline remember save shape success",fax:"machine office phone send",featured_play_list:"audio collection highlighted item music playlist recommended",featured_video:"advertisement advertisment highlighted item play recommended watch,advertised",feed:"article headline information newspaper public social timeline",feedback:"! alert announcement attention bubble caution chat comment communicate danger error exclamation important mark message notification speech symbol warning",female:"gender girl lady social symbol woman women",fence:"backyard barrier boundaries boundary home house protection",festival:"circus event local maps places tent tour travel",fiber_dvr:"alphabet character digital electronics font letter network recorder symbol text tv type video",fiber_manual_record:"circle dot play watch",fiber_new:"alphabet character font letter network symbol text type",fiber_pin:"alphabet character font letter network symbol text type",fiber_smart_record:"circle dot play watch",fifteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",file_copy:"bill clone content cut document duplicate invoice item multiple page past",file_download:"arrows downloads drive export install upload",file_download_done:"arrows check downloads drive installed tick upload",file_download_off:"arrow disabled drive enabled export install on save slash upload",file_open:"arrow document drive left page paper",file_present:"clip data document drive folders note paper reminder sheet slide storage writing",file_upload:"arrows download drive export",filter:"editing effect image landscape mountains photography picture settings",filter_1:"digit editing effect images multiple number photography pictures settings stack symbol",filter_2:"digit editing effect images multiple number photography pictures settings stack symbol",filter_3:"digit editing effect images multiple number photography pictures settings stack symbol",filter_4:"digit editing effect images multiple number photography pictures settings stack symbol",filter_5:"digit editing effect images multiple number photography pictures settings stack symbol",filter_6:"digit editing effect images multiple number photography pictures settings stack symbol",filter_7:"digit editing effect images multiple number photography pictures settings stack symbol",filter_8:"digit editing effect images multiple number photography pictures settings stack symbol",filter_9:"digit editing effect images multiple number photography pictures settings stack symbol",filter_9_plus:"+ digit editing effect images multiple number photography pictures settings stack symbol",filter_alt:"edit funnel options refine sift",filter_alt_off:"[offline] disabled edit funnel options refine sift slash",filter_b_and_w:"black contrast editing effect grayscale images photography pictures settings white",filter_center_focus:"camera dot edit image photography picture",filter_drama:"camera cloud editing effect image photography picture sky",filter_frames:"boarders border camera center editing effect filters focus image options photography picture",filter_hdr:"camera editing effect image mountains photography picture",filter_list:"lines organize sort",filter_list_off:"[offline] alt disabled edit options refine sift slash",filter_none:"multiple stack",filter_tilt_shift:"blur center editing effect focus images photography pictures",filter_vintage:"editing effect flower images photography pictures",find_in_page:"data document drive file folders glass look magnifying paper search see sheet slide writing",find_replace:"around arrows glass inprogress loading look magnifying refresh renew rotate search see",fingerprint:"biometrics identification identity reader thumbprint touchid verification",fire_extinguisher:"emergency water",fireplace:"chimney flame home house living pit room warm winter",first_page:"arrow back chevron left rewind",fitbit:"athlete athletic exercise fitness hobby",fitness_center:"athlete dumbbell exercise gym health hobby places sport weights workout",fit_screen:"enlarge format layout reduce scale size",five_g:"5g alphabet cellular character data digit font letter mobile network number phone signal speed symbol text type wifi",five_k:"5000 5K alphabet character digit display font letter number pixels resolution symbol text type video",five_k_plus:"+ 5000 5K alphabet character digit display font letter number pixels resolution symbol text type video",five_mp:"camera digit font image letters megapixels number quality resolution symbol text type",fivteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",flag:"country goal mark nation report start",flag_circle:"country goal mark nation report round start",flaky:"approve check close complete contrast done exit mark no ok options select stop tick verified yes",flare:"bright editing effect images lensflare light photography pictures shine sparkle star sun",flash_auto:"camera electric fast lightning thunderbolt",flashlight_off:"disabled enabled on slash",flashlight_on:"disabled enabled off slash",flash_off:"camera disabled electric enabled fast lightning on slash thunderbolt",flash_on:"camera disabled electric enabled fast lightning off slash thunderbolt",flatware:"cafeteria cutlery diner dining eating fork room spoon",flight:"airplane airport flying transportation travel trip",flight_class:"airplane business first seat transportation travel trip window",flight_land:"airplane airport arrival arriving flying landing transportation travel",flight_takeoff:"airplane airport departed departing flying landing transportation travel",flip:"editing image orientation scanning",flip_camera_android:"center editing front image mobile orientation rear reverse rotate turn",flip_camera_ios:"android editing front image mobile orientation rear reverse rotate turn",flip_to_back:"arrangement format front layout move order sort",flip_to_front:"arrangement back format layout move order sort",flutter_dash:"bird mascot",fmd_bad:"! alert attention caution danger destination direction error exclamation important location maps mark notification pin place symbol warning",fmd_good:"destination direction location maps pin place stop",folder:"data directory document drive file folders sheet slide storage",folder_delete:"bin can data document drive file folders garbage remove sheet slide storage trash",folder_off:"[online] data disabled document drive enabled file folders sheet slash slide storage",folder_open:"data directory document drive file folders sheet slide storage",folder_shared:"account collaboration data directory document drive face human people person profile sheet slide storage team user",folder_special:"bookmark data directory document drive favorite file highlight important marked saved shape sheet slide star storage",folder_zip:"compress data document drive file folders open sheet slide storage",follow_the_signs:"arrow body directional human people person right social",font_download:"A alphabet character letter square symbol text type",font_download_off:"alphabet character disabled enabled letter slash square symbol text type",food_bank:"architecture building charity eat estate fork house knife meal place real residence residential shelter utensils",forest:"jungle nature plantation plants trees woodland",fork_left:"arrows directions maps navigation path route sign traffic",fork_right:"arrows directions maps navigation path route sign traffic",format_align_center:"alignment doc editing editor lines spreadsheet text type writing",format_align_justify:"alignment density doc editing editor extra lines small spreadsheet text type writing",format_align_left:"alignment doc editing editor lines spreadsheet text type writing",format_align_right:"alignment doc editing editor lines spreadsheet text type writing",format_bold:"B alphabet character doc editing editor font letter spreadsheet styles symbol text type writing",format_clear:"T alphabet character disabled doc editing editor enabled font letter off slash spreadsheet style symbol text type writing",format_color_fill:"bucket doc editing editor paint spreadsheet style text type writing",format_color_reset:"clear disabled doc droplet editing editor enabled fill liquid off on paint slash spreadsheet style text type water writing",format_color_text:"doc editing editor fill paint spreadsheet style type writing",format_indent_decrease:"alignment doc editing editor indentation paragraph spreadsheet text type writing",format_indent_increase:"alignment doc editing editor indentation paragraph spreadsheet text type writing",format_italic:"alphabet character doc editing editor font letter spreadsheet style symbol text type writing",format_line_spacing:"alignment doc editing editor spreadsheet text type writing",format_list_bulleted:"alignment doc editing editor notes spreadsheet task text todo type writing",format_list_numbered:"alignment digit doc editing editor notes spreadsheet symbol task text todo type writing",format_list_numbered_rtl:"alignment digit doc editing editor notes spreadsheet symbol task text todo type writing",format_overline:"alphabet character doc editing editor font letter spreadsheet style symbol text type under writing",format_paint:"brush color doc editing editor fill paintroller spreadsheet style text type writing",format_quote:"doc editing editor quotation spreadsheet text type writing",format_shapes:"alphabet character color doc editing editor fill font letter paint spreadsheet style symbol text type writing",format_size:"alphabet character color doc editing editor fill font letter paint spreadsheet style symbol text type writing",format_strikethrough:"alphabet character doc editing editor font letter spreadsheet style symbol text type writing",format_textdirection_l_to_r:"alignment doc editing editor ltr paragraph spreadsheet type writing",format_textdirection_r_to_l:"alignment doc editing editor paragraph rtl spreadsheet type writing",format_underlined:"alphabet character doc editing editor font letter spreadsheet style symbol text type writing",forum:"bubble chat comment communicate community conversation feedback hub messages speech talk",forward:"arrow mail message playback right sent",forward_10:"arrow circle controls digit fast music number play rotate seconds speed symbol time video",forward_30:"arrow circle controls digit fast music number rotate seconds speed symbol time video",forward_5:"10 arrow circle controls digit fast music number rotate seconds speed symbol time video",forward_to_inbox:"arrow email envelop letter message send",foundation:"architecture base basis building construction estate home house real residential",four_g_mobiledata:"alphabet cellular character digit font letter network number phone signal speed symbol text type wifi",four_g_plus_mobiledata:"alphabet cellular character digit font letter network number phone signal speed symbol text type wifi",four_k:"4000 4K alphabet character digit display font letter number pixels resolution symbol text type video",four_k_plus:"+ 4000 4K alphabet character digit display font letter number pixels resolution symbol text type video",four_mp:"camera digit font image letters megapixels number quality resolution symbol text type",fourteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",free_breakfast:"beverage cafe coffee cup drink mug tea",fullscreen:"adjust application components interface size ui ux view website",fullscreen_exit:"adjust application components interface size ui ux view website",functions:"average calculate count doc editing editor math sigma spreadsheet style sum text type writing",gamepad:"buttons console controller device gaming playstation video",games:"adjust arrows controller direction dpad gaming left move nintendo playstation right xbox",garage:"automobile automotive cars direction maps transportation travel vehicle",gas_meter:"droplet energy measure nest usage water",gavel:"agreement contract court document government hammer judge law mallet official police rules terms",gesture:"drawing finger gestures hand line motion",get_app:"arrows downloads export install play pointing retrieve upload",gif:"alphabet animated animation bitmap character font format graphics interchange letter symbol text type",gif_box:"alphabet animated animation bitmap character font format graphics interchange letter symbol text type",girl:"body female gender human lady people person social symbol woman women",gite:"architecture estate home hostel house maps place real residence residential stay traveling",git_hub:"brand code",g_mobiledata:"alphabet character font letter network service symbol text type",golf_course:"athlete athletic ball club entertainment flag golfer golfing hobby hole places putt sports",google:"brand logo",gpp_bad:"cancel certified close error exit no privacy private protection remove security shield sim stop verified",gpp_good:"certified check ok pass security shield sim tick",gpp_maybe:"! alert attention caution certified danger error exclamation important mark notification privacy private protection security shield sim symbol verified warning",gps_fixed:"destination direction location maps pin place pointer stop tracking",gps_not_fixed:"destination direction disabled enabled fixed location maps not off online place pointer slash tracking",gps_off:"destination direction disabled enabled fixed location maps not offline place pointer slash tracking",grade:"achievement important likes marked rated rating reward saved shape special star",gradient:"color editing effect filter images photography pictures",grading:"approve check complete document done feedback grade mark ok reviewed select tick validate verified writing yes",grain:"dots editing effect filter images photography pictures",graphic_eq:"audio equalizer music recording sound voice",grass:"backyard fodder ground home lawn plant turf",grid3x3:"layout line space",grid4x4:"by layout lines space",grid_goldenratio:"layout lines space",grid_off:"collage disabled enabled image layout on slash view",grid_on:"collage disabled enabled image layout off sheet slash view",grid_view:"application blocks components dashboard design interface layout screen square tiles ui ux website window",group:"accounts committee face family friends humans network people persons profiles social team users",group_add:"accounts committee face family friends humans increase more network people persons plus profiles social team users",group_remove:"accounts committee face family friends humans network people persons profiles social team users",groups:"body club collaboration crowd gathering human meeting people person social teams",group_work:"alliance circle collaboration film partnership reel teamwork together",g_translate:"emblem google language logo mark speaking speech translator words",hail:"body human people person pick public stop taxi transportation",handyman:"build construction fix hammer repair screwdriver tools",hardware:"break construction hammer nail repair tool",hd:"alphabet character definition display font high letter movies quality resolution screen symbol text tv type video",hdr_auto:"A alphabet camera character circle dynamic font high letter photo range symbol text type",hdr_auto_select:"+ A alphabet camera character circle dynamic font high letter photo range symbol text type",hdr_enhanced_select:"add alphabet character dynamic font high letter plus range symbol text type",hdr_off:"alphabet character disabled dynamic enabled enhance font high letter range select slash symbol text type",hdr_off_select:"alphabet camera character circle disabled dynamic enabled font high letter photo range slash symbol text type",hdr_on:"add alphabet character dynamic enhance font high letter plus range select symbol text type",hdr_on_select:"+ alphabet camera character circle dynamic font high letter photo range symbol text type",hdr_plus:"+ add alphabet character circle dynamic enhance font high letter range select symbol text type",hdr_strong:"circles dots dynamic enhance high range",hdr_weak:"circles dots dynamic enhance high range",headphones:"accessory audio device earphone headset listen music sound",headphones_battery:"accessory audio charging device earphone headset listen music sound",headset:"accessory audio device earbuds earmuffs earphone headphones listen music sound",headset_mic:"accessory audio chat device earphone headphones listen music sound talk",headset_off:"accessory audio chat device disabled earphone enabled headphones listen mic music slash sound talk",healing:"bandage bandaid editing emergency fix health hospital image medicine",health_and_safety:"+ add certified plus privacy private protection security shield symbol verified",hearing:"accessibility accessible aid handicap help impaired listen sound volume",hearing_disabled:"accessibility accessible aid enabled handicap help impaired listen off on slash sound volume",heart_broken:"break core crush health nucleus split",heat_pump:"air conditioner cool energy furnance nest usage",height:"arrows color doc down editing editor fill format paint resize spreadsheet stretch style text type up writing",help:"? alert announcement assistance circle information mark punctuation question shape support symbol",help_center:"? assistance information mark punctuation question support symbol",help_outline:"? alert announcement assistance circle information mark punctuation question shape support symbol",hevc:"alphabet character coding efficiency font high letter symbol text type video",hexagon:"shape sides six",hide_image:"disabled enabled landscape mountains off on photography picture slash",hide_source:"circle disabled enabled offline on shape slash",highlight:"color doc editing editor emphasize fill flashlight format marker paint spreadsheet style text type writing",highlight_alt:"arrow box click cursor draw focus pointer selection target",highlight_off:"cancel circle clear click close delete disable exit focus no quit remove stop target times",high_quality:"alphabet character definition display font hq letter movies resolution screen symbol text tv type",hiking:"backpacking bag climbing duffle mountain social sports stick trail travel walking",history:"arrow backwards clock date refresh renew reverse revert rotate schedule time turn undo",history_edu:"document education feather letter paper pen quill school tools write writing",history_toggle_off:"clock date schedule time",hls:"alphabet character developer engineering font letter platform symbol text type",hls_off:"[offline] alphabet character developer disabled enabled engineering font letter platform slash symbol text type",h_mobiledata:"alphabet character font letter network service symbol text type",holiday_village:"architecture beach camping cottage estate home house lake lodge maps place real residence residential stay traveling vacation",home:"address application--house architecture building components design estate homepage interface layout place real residence residential screen shelter structure unit ux website window",home_max:"device gadget hardware internet iot nest smart things",home_mini:"Internet device gadget hardware iot nest smart things",home_repair_service:"equipment fix kit mechanic repairing toolbox tools workshop",home_work:"architecture building estate house office place real residence residential shelter",horizontal_rule:"gmail line novitas",horizontal_split:"bars format layout lines stacked",hotel:"bed body human people person sleep stay travel trip",hot_tub:"bathing bathroom bathtub hotel human jacuzzi person shower spa steam travel water",hourglass_bottom:"countdown half loading minutes time waiting",hourglass_disabled:"clock countdown empty enabled loading minutes off on slash time waiting",hourglass_empty:"countdown loading minutes start time waiting",hourglass_full:"countdown loading minutes time waiting",hourglass_top:"countdown half loading minutes time waiting",house:"architecture building estate family homepage places real residence residential shelter",houseboat:"architecture beach estate floating home maps place real residence residential sea stay traveling vacation",house_siding:"architecture building construction estate exterior facade home real residential",how_to_reg:"approve ballot check complete done election mark ok poll register registration select tick to validate verified vote yes",how_to_vote:"ballot election poll",h_plus_mobiledata:"+ alphabet character font letter network service symbol text type",html:"alphabet brackets character code css developer engineering font letter platform symbol text type",http:"alphabet character font internet letter network symbol text transfer type url website",https:"connection encrypt internet key locked network password privacy private protection safety secure security ssl web",hub:"center connection core focal network nucleus point topology",hvac:"air conditioning heating ventilation",icecream:"dessert food snack",ice_skating:"athlete athletic entertainment exercise hobby shoe skates social sports travel",image:"disabled enabled frame hide landscape mountains off on photography picture slash",image_aspect_ratio:"photography picture rectangle square",image_not_supported:"disabled enabled landscape mountains off on photography picture slash",image_search:"find glass landscape look magnifying mountains photography picture see",imagesearch_roller:"art paint",important_devices:"Android cell computer desktop hardware iOS mobile monitor phone star tablet web",import_contacts:"address book friends information magazine open",import_export:"arrows direction down explort up",inbox:"archive email incoming message",indeterminate_check_box:"application button components control design form interface minus screen selected selection square toggle ui undetermined ux website",info:"about alert announcement announcment assistance bubble circle details help information service support",input:"arrow box download login move right",insert_chart:"analytics barchart bars data diagram infographic measure metrics statistics tracking",insert_chart_outlined:"analytics bars data diagram infographic measure metrics statistics tracking",insert_comment:"add bubble chat feedback message",insert_drive_file:"bill document format invoice item sheet slide",insert_emoticon:"account emoji face happy human like people person profile sentiment smiley user",insert_invitation:"agenda calendar date event mark month range remember reminder today week",insert_link:"add anchor attach clip file mail media",insert_page_break:"document file paper",insert_photo:"image landscape mountains photography picture wallpaper",insights:"analytics bars chart data diagram infographic measure metrics stars statistics tracking",instagram:"brand logo social",install_desktop:"Android chrome device display fix hardware iOS mac monitor place pwa screen web window",install_mobile:"Android cell device hardware iOS phone pwa tablet",integration_instructions:"brackets clipboard code css developer document engineering html platform",interests:"circle heart shapes social square triangle",interpreter_mode:"language microphone person speaking symbol",inventory:"archive box buy check clipboard document e-commerce file list organize packages product purchase shop stock store supply",inventory2:"archive box file organize packages product stock storage supply",invert_colors:"droplet editing hue inverted liquid palette tone water",invert_colors_off:"disabled droplet enabled hue inverted liquid offline opacity palette slash tone water",ios_share:"arrows button direction export internet link send sharing social up website",iron:"appliance clothes electric ironing machine object",iso:"add editing effect image minus photography picture plus sensor shutter speed subtract",javascript:"alphabet brackets character code css developer engineering font html letter platform symbol text type",join_full:"circle combine command left outter right sql",join_inner:"circle command matching sql values",join_left:"circle command matching sql values",join_right:"circle command matching sql values",kayaking:"athlete athletic body canoe entertainment exercise hobby human lake paddle paddling people person rafting river row social sports summer travel water",key:"blackout password restricted secret unlock",keyboard:"computer device hardware input keypad letter office text type",keyboard_alt:"computer device hardware input keypad letter office text type",keyboard_arrow_down:"arrows chevron open",keyboard_arrow_left:"arrows chevron",keyboard_arrow_right:"arrows chevron open start",keyboard_arrow_up:"arrows chevron submit",keyboard_backspace:"arrow left",keyboard_capslock:"arrow up",keyboard_command_key:"button command control key",keyboard_control_key:"control key",keyboard_double_arrow_down:"arrows direction multiple navigation",keyboard_double_arrow_left:"arrows direction multiple navigation",keyboard_double_arrow_right:"arrows direction multiple navigation",keyboard_double_arrow_up:"arrows direction multiple navigation",keyboard_hide:"arrow computer device down hardware input keypad text",keyboard_option_key:"alt key modifier",keyboard_return:"arrow back left",keyboard_tab:"arrow next right",keyboard_voice:"microphone noise recorder speaker",key_off:"[offline] disabled enabled on password slash unlock",king_bed:"bedroom double furniture home hotel house night pillows queen rest sleep",kitchen:"appliance cabinet cold food freezer fridge home house ice places refrigerator storage",kitesurfing:"athlete athletic beach body entertainment exercise hobby human people person social sports travel water",label:"badge favorite indent item library mail remember save stamp sticker tag",label_important:"badge favorite important. indent item library mail remember save stamp sticker tag wing",label_off:"disabled enabled favorite indent library mail on remember save slash stamp sticker tag wing",lan:"computer connection data internet network service",landscape:"image mountains nature photography picture",language:"country earth globe i18n internet l10n planet website world www",laptop:"Android chrome computer connect desktop device display hardware iOS link mac monitor smart tv web windows",laptop_chromebook:"Android chromebook device display hardware iOS mac monitor screen web window",laptop_mac:"Android apple chrome device display hardware iOS monitor screen web window",laptop_windows:"Android chrome device display hardware iOS mac monitor screen web",last_page:"application arrow chevron components end forward interface right screen ui ux website",launch:"application arrow box components core interface internal new open screen ui ux website window",layers:"arrange disabled enabled interaction maps off overlay pages slash stack",layers_clear:"arrange delete disabled enabled interaction maps off overlay pages slash",leaderboard:"analytics bars chart data diagram infographic measure metrics statistics tracking",leak_add:"connection data link network service signals synce wireless",leak_remove:"connection data disabled enabled link network offline service signals slash synce wireless",legend_toggle:"analytics chart data diagram infographic measure metrics monitoring stackdriver statistics tracking",lens:"circle full geometry moon",lens_blur:"camera dim dot effect foggy fuzzy image photo soften",library_add:"+ collection layers multiple music new plus save stacked symbol video",library_add_check:"approve collection complete done layers mark multiple music ok select stacked tick validate verified video yes",library_books:"add album audio collection reading",library_music:"add album audio collection song sounds",light:"bulb ceiling hanging inside interior lamp lighting pendent room",lightbulb:"alert announcement idea information learning mode",lightbulb_circle:"alert announcement idea information",light_mode:"brightness day device lighting morning mornng sky sunny",linear_scale:"application components design interface layout measure menu screen slider ui ux website window",line_axis:"dash horizontal stroke vertical",line_style:"dash dotted editor rule spacing",line_weight:"editor height size spacing style thickness",link:"anchor chain clip connection external hyperlink linked links multimedia unlisted url",linked_camera:"connection lens network photography picture signals sync wireless",linked_in:"brand logo social",link_off:"anchor attached chain clip connection disabled enabled linked links multimedia slash unlink url",liquor:"alcohol bar bottle club cocktail drink food party store wine",list:"editor file format index menu options playlist task todo",list_alt:"box contained editor format lines reorder sheet stacked task title todo",live_help:"? alert announcement assistance bubble chat comment communicate faq information mark message punctuation question speech support symbol",live_tv:"Android antennas chrome desktop device hardware iOS mac monitor movie play stream television web window",living:"chair comfort couch decoration furniture home house lounging loveseat room seating sofa",local_activity:"event star things ticket",local_airport:"airplane flight flying transportation travel trip",local_atm:"bill card cart cash coin commerce credit currency dollars financial money online payment price profit shopping symbol",local_bar:"alcohol bottle club cocktail drink food liquor martini wine",local_cafe:"bottle coffee cup drink food mug restaurant tea",local_car_wash:"automobile cars maps transportation travel vehicle",local_convenience_store:"-- 24 bill building business card cash coin commerce company credit currency dollars maps market money new online payment plus shopping storefront symbol",local_dining:"cutlery eat food fork knife meal restaurant spoon",local_drink:"cup droplet glass liquid park water",local_fire_department:"911 firefighter flame hot",local_florist:"flower shop",local_gas_station:"auto car filling fuel gasoline oil station vehicle",local_grocery_store:"market shop",local_hospital:"911 aid cross doctor emergency first health medical medicine plus",local_hotel:"bed body human people person sleep stay travel trip",local_laundry_service:"cleaning clothing dryer hotel washer",local_library:"book community learning person read",local_mall:"bill building business buy card cart cash coin commerce credit currency dollars handbag money online payment shopping storefront",local_offer:"deal discount price shopping store tag",local_parking:"alphabet auto car character font garage letter symbol text type vehicle",local_pharmacy:"911 aid cross emergency first food hospital medicine places",local_phone:"booth call telecommunication",local_pizza:"drink fastfood meal",local_police:"911 badge law officer protection security shield",local_post_office:"delivery email envelop letter message package parcel postal send stamp",local_printshop:"draft fax ink machine office paper printer send",local_see:"camera lens photography picture",local_shipping:"automobile cars delivery letter mail maps office package parcel postal semi send shopping stamp transportation truck vehicle",local_taxi:"automobile cab call cars direction lyft maps public transportation uber vehicle yellow",location_city:"apartments architecture buildings business company estate home landscape place real residence residential shelter town urban",location_disabled:"destination direction enabled maps off pin place pointer slash stop tracking",location_off:"destination direction disabled enabled gps maps pin place room slash stop",location_on:"destination direction disabled enabled gps maps off pin place room slash stop",location_searching:"destination direction maps pin place pointer stop tracking",lock:"connection key locked logout padlock password privacy private protection safety secure security signout",lock_clock:"date locked password privacy private protection safety schedule secure security time",lock_open:"connection key login padlock password privacy private protection register safety secure security signin signup unlocked",lock_reset:"around inprogress loading locked password privacy private protection refresh renew rotate safety secure security turn",login:"access application arrow components design enter interface left screen ui ux website",logo_dev:"dev.to",logout:"application arrow components design exit interface leave login right screen ui ux website",looks:"circle half rainbow",looks_3:"digit numbers square symbol",looks_4:"digit numbers square symbol",looks_5:"digit numbers square symbol",looks_6:"digit numbers square symbol",looks_one:"1 digit numbers square symbol",looks_two:"2 digit numbers square symbol",loop:"around arrows direction inprogress loader loading music navigation refresh renew repeat rotate turn",loupe:"+ add details focus glass magnifying new plus symbol",low_priority:"arrange arrow backward bottom list move order task todo",loyalty:"badge card credit heart love membership miles points program sale subscription tag travel trip",lte_mobiledata:"alphabet character font internet letter network speed symbol text type wifi wireless",lte_plus_mobiledata:"+ alphabet character font internet letter network speed symbol text type wifi wireless",luggage:"airport baggage carry flight hotel on suitcase travel trip",lunch_dining:"breakfast dinner drink fastfood hamburger meal",lyrics:"audio bubble chat comment communicate feedback key message music note song sound speech track",mail:"email envelope inbox letter message send",mail_lock:"email envelop letter locked message password privacy private protection safety secure security send",mail_outline:"email envelope letter message note post receive send write",male:"boy gender man social symbol",man:"boy gender male social symbol",manage_accounts:"change details face gear options people person profile service-human settings user",manage_search:"glass history magnifying text",map:"destination direction location maps pin place route stop travel",maps_home_work:"building house office",maps_ugc:"+ add bubble comment communicate feedback message new plus speech symbol",margin:"design layout padding size square",mark_as_unread:"envelop letter mail postal receive send",mark_chat_read:"approve bubble check comment communicate complete done message ok select sent speech tick verified yes",mark_chat_unread:"bubble circle comment communicate message notification speech",mark_email_read:"approve check complete done envelop letter message note ok select send sent tick yes",mark_email_unread:"check circle envelop letter message note notification send",markunread:"email envelope letter message send",markunread_mailbox:"deliver envelop letter postal postbox receive send",masks:"air cover covid face hospital medical pollution protection respirator sick social",maximize:"application components design interface line screen shape ui ux website",media_bluetooth_off:"connection connectivity device disabled enabled music note offline paring signal slash symbol wireless",media_bluetooth_on:"connection connectivity device disabled enabled music note off online paring signal slash symbol wireless",mediation:"alternative arrows compromise direction dots negotiation party right structure",medical_services:"aid bag briefcase emergency first kit medicine",medication:"doctor drug emergency hospital medicine pharmacy pills prescription",meeting_room:"building doorway entrance home house interior logout office open places signout",memory:"card chip digital micro processor sd storage",menu:"application components hamburger interface lines playlist screen ui ux website",menu_book:"dining food meal page restaurant",menu_open:"application arrow chevron components hamburger interface left lines screen ui ux website",merge:"arrows directions maps navigation path route sign traffic",merge_type:"arrow combine direction format text",message:"bubble chat comment communicate feedback speech talk text",mic:"hearing microphone noise record search sound speech voice",mic_external_off:"audio disabled enabled microphone slash sound voice",mic_external_on:"audio disabled enabled microphone off slash sound voice",mic_none:"hearing microphone noise record sound voice",mic_off:"audio disabled enabled hearing microphone noise recording slash sound voice",microwave:"appliance cooking electric heat home house kitchen machine",military_tech:"army award badge honor medal merit order privilege prize rank reward ribbon soldier star status trophy winner",minimize:"application components design interface line screen shape ui ux website",missed_video_call:"arrow camera filming hardware image motion picture record videography",mms:"bubble chat comment communicate feedback image landscape message mountains multimedia photography picture speech",mobiledata_off:"arrow disabled down enabled internet network on slash speed up wifi wireless",mobile_friendly:"Android approve cell check complete device done hardware iOS mark ok phone select tablet tick validate verified yes",mobile_off:"Android cell device disabled enabled hardware iOS phone silence slash tablet",mobile_screen_share:"Android arrow cell device hardware iOS mirror monitor phone screencast streaming tablet tv wireless",mode:"compose create draft draw edit pencil write",mode_comment:"bubble chat comment communicate feedback message mode speech",mode_edit:"compose create draft draw pencil write",mode_edit_outline:"compose create draft draw pencil write",model_training:"arrow bulb idea inprogress light loading refresh renew restore reverse rotate",mode_night:"dark disturb moon sleep weather",mode_of_travel:"arrow destination direction location maps pin place stop transportation trip",mode_standby:"disturb power sleep target",monetization_on:"bill card cash circle coin commerce cost credit currency dollars finance money online payment price profit sale shopping symbol",money:"100 bill card cash coin commerce cost credit currency digit dollars finance number online payment price profit shopping symbol",money_off:"bill card cart cash coin commerce credit currency disabled dollars enabled finance money online payment price profit shopping slash symbol",money_off_csred:"bill card cart cash coin commerce credit currency disabled dollars enabled online payment shopping slash symbol",monitor:"Android chrome device display hardware iOS mac screen web window",monitor_weight:"body device diet health scale smart",monochrome_photos:"black camera image photography picture white",mood:"emoji emoticon emotions expressions face feelings glad happiness happy like person pleased smiley smiling social survey",mood_bad:"disappointment dislike emoji emoticon emotions expressions face feelings person rating smiley social survey unhappiness unhappy unpleased unsmile unsmiling",moped:"automobile bike cars direction maps motorized public scooter transportation vehicle vespa",more:"3 archive badge bookmark dots etc favorite indent label remember save stamp sticker tab tag three",more_horiz:"3 application components dots etc horizontal interface ios pending screen status three ui ux website",more_time:"+ add clock date new plus schedule symbol",more_vert:"3 android application components dots etc interface screen three ui ux vertical website",motion_photos_auto:"A alphabet animation automatic character circle font gif letter live symbol text type video",motion_photos_off:"animation circle disabled enabled slash video",mouse:"click computer cursor device hardware wireless",move_down:"arrow direction jump navigation transfer",move_to_inbox:"archive arrow down email envelop incoming letter message move send to",move_up:"arrow direction jump navigation transfer",movie:"cinema film media screen show slate tv video watch",movie_creation:"clapperboard film movies slate video",movie_filter:"clapperboard creation film movies slate stars video",moving:"arrow direction navigation travel up",mp:"alphabet character font image letter megapixel photography pixels quality resolution symbol text type",multiline_chart:"analytics bars data diagram infographic line measure metrics multiple statistics tracking",multiple_stop:"arrows directions dots left maps navigation right",museum:"architecture attraction building estate event exhibition explore local palces places real see shop store tour",music_note:"audiotrack key sound",music_off:"audiotrack disabled enabled key note on slash sound",music_video:"band mv recording screen tv watch",my_location:"destination direction maps navigation pin place point stop",nat:"communication",nature:"forest outdoor outside park tree wilderness",nature_people:"activity body forest human outdoor outside park person tree wilderness",navigate_before:"arrows direction left",navigate_next:"arrows direction right",navigation:"arrow destination direction location maps pin place point stop",nearby_error:"! alert attention caution danger exclamation important mark notification symbol warning",nearby_off:"disabled enabled on slash",near_me:"arrow destination direction location maps navigation pin place point stop",near_me_disabled:"destination direction enabled location maps navigation off pin place point slash",nest_cam_wired_stand:"camera filming hardware image motion picture videography",network_cell:"cellular data internet mobile phone speed wifi wireless",network_check:"connection internet meter signal speed tick wifi wireless",network_locked:"alert available cellular connection data error internet mobile not privacy private protection restricted safety secure security service signal warning wifi wireless",network_wifi:"cellular data internet mobile phone speed wireless",new_releases:"! alert announcement attention burst caution danger error exclamation important mark notification star symbol warning",newspaper:"article data document drive file folders magazine media notes page sheet slide text writing",next_plan:"arrow circle right",next_week:"arrow baggage briefcase business suitcase",nfc:"communication data field mobile near wireless",nightlife:"alcohol bar bottle club cocktail dance drink food glass liquor music note wine",nightlight:"dark disturb mode moon sleep weather",nightlight_round:"dark half mode moon",night_shelter:"architecture bed building estate homeless house place real sleep",nights_stay:"cloud crescent dark mode moon phases silence silent sky time weather",nine_k:"9000 9K alphabet character digit display font letter number pixels resolution symbol text type video",nine_k_plus:"+ 9000 9K alphabet character digit display font letter number pixels resolution symbol text type video",nine_mp:"camera digit font image letters megapixels number quality resolution symbol text type",nineteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",no_accounts:"avatar disabled enabled face human offline people person profile slash thumbnail unavailable unidentifiable unknown user",no_backpack:"accessory bookbag knapsack travel",no_cell:"Android device disabled enabled hardware iOS mobile off phone slash tablet",no_drinks:"alcohol beverage bottle cocktail food liquor wine",no_encryption:"disabled enabled lock off password safety security slash",no_encryption_gmailerrorred:"disabled enabled locked off slash",no_flash:"camera disabled enabled image lightning off on photography picture slash thunderbolt",no_food:"disabled drink enabled fastfood hamburger meal off on slash",no_luggage:"baggage carry disabled enabled off on slash suitcase travel",no_meals:"dining disabled eat enabled food fork knife off restaurant slash spoon utensils",no_meeting_room:"building disabled doorway enabled entrance home house interior office on open places slash",no_photography:"camera disabled enabled image off on picture slash",nordic_walking:"athlete athletic body entertainment exercise hiking hobby human people person social sports travel walker",north:"arrow directional maps navigation up",north_east:"arrow maps navigation noth right up",north_west:"arrow directional left maps navigation up",no_sim:"camera card device eject insert memory phone storage",no_stroller:"baby care carriage children disabled enabled infant kid newborn off on parents slash toddler young",not_accessible:"accessibility body handicap help human person wheelchair",note:"bookmark message paper",note_add:"+ -doc create data document drive file folders new page paper plus sheet slide symbol writing",note_alt:"clipboard document file memo page paper writing",notes:"comment document text write writing",notification_add:"+ active alarm alert bell chime notifications notify plus reminder ring sound symbol",notification_important:"! active alarm alert announcement attention bell caution chime danger error exclamation feedback mark notifications notify problem reminder ring sound symbol warning",notifications:"active alarm alert bell chime notify reminder ring sound",notifications_active:"alarm alert bell chime notify reminder ringing sound",notifications_none:"alarm alert bell notify reminder ring sound",notifications_off:"active alarm alert bell chime disabled enabled notify offline reminder ring slash sound",notifications_paused:"--- active alarm aleet alert bell chime ignore notify pause quiet reminder ring sleep snooze sound zzz",not_interested:"allowed banned cancel circle close disabled dislike exit interested not off prohibited quit remove stop",not_listed_location:"? assistance destination direction help information maps pin place punctuation questionmark stop support symbol",no_transfer:"automobile bus cars direction disabled enabled maps off public slash transportation vehicle",not_started:"circle media pause play video",offline_bolt:"circle electric fast flash lightning spark thunderbolt",offline_pin:"approve checkmark circle complete done ok select tick validate verified yes",offline_share:"Android arrow cell connect device direction hardware iOS link mobile multiple phone right tablet",oil_barrel:"droplet gasoline nest water",ondemand_video:"Android chrome desktop device hardware iOS mac monitor play television tv web window",on_device_training:"arrow bulb call cell contact hardware idea inprogress light loading mobile model refresh renew restore reverse rotate telephone",one_k:"1000 1K alphabet character digit display font letter number pixels resolution symbol text type video",one_kk:"10000 10K alphabet character digit display font letter number pixels resolution symbol text type video",one_k_plus:"+ 1000 1K alphabet character digit display font letter number pixels resolution symbol text type video",online_prediction:"bulb connection idea light network signal wireless",opacity:"color droplet hue inverted liquid palette tone water",open_in_browser:"arrow box new up website window",open_in_full:"action arrows expand grow move",open_in_new:"application arrow box components interface screen ui ux website window",open_in_new_off:"arrow box disabled enabled export on slash window",open_with:"arrows directional expand move",other_houses:"architecture cottage estate home maps place real residence residential stay traveling",outbound:"arrow circle directional right up",outbox:"mail send sent",outdoor_grill:"barbecue barbeque bbq charcoal cooking home house outside",outlet:"connecter electricity plug power",outlined_flag:"country goal mark nation report start",padding:"design layout margin size square",pages:"article gplus paper post star",pageview:"document find glass magnifying paper search",paid:"circle currency money payment transaction",palette:"art colors filters paint",panorama:"angle image mountains photography picture view wide",panorama_fish_eye:"angle circle image photography picture wide",panorama_horizontal:"angle image photography picture wide",panorama_horizontal_select:"angle image photography picture wide",panorama_photosphere:"angle horizontal image photography picture wide",panorama_photosphere_select:"angle horizontal image photography picture wide",panorama_vertical:"angle image photography picture wide",panorama_vertical_select:"angle image photography picture wide",panorama_wide_angle:"image photography picture",panorama_wide_angle_select:"image photography picture",pan_tool:"drag fingers gesture hands human move scan stop touch wait",paragliding:"athlete athletic body entertainment exercise fly hobby human parachute people person skydiving social sports travel",park:"attraction fresh local nature outside plant tree",party_mode:"camera lens photography picture",password:"key login pin security star unlock",pattern:"key login password pin security star unlock",pause:"controls media music pending player status video wait",pause_circle:"controls media music video",pause_circle_filled:"controls media music pending status video wait",pause_circle_outline:"controls media music pending status video wait",pause_presentation:"application desktop device pending screen share slides status wait website window www",payment:"bill cash charge coin commerce cost creditcard currency dollars finance financial information money online price shopping symbol",payments:"bill card cash coin commerce cost credit currency dollars finance layer money multiple online price shopping symbol",pedal_bike:"automobile bicycle cars direction human maps public route scooter transportation vehicle vespa",pending:"circle dots loading progress waiting",pending_actions:"clipboard clock date document remember schedule time",pentagon:"five shape sides",people:"accounts committee community face family friends group humans network persons profiles social team users",people_alt:"accounts committee face family friends group humans network persons profiles social team users",people_outline:"accounts committee face family friends group humans network persons profiles social team users",percent:"math number symbol",perm_camera_mic:"image microphone min photography picture speaker",perm_contact_calendar:"account agenda date face human information people person profile schedule time user",perm_data_setting:"cellular configure gear information network settings wifi wireless",perm_device_information:"Android alert announcement cell hardware iOS important mobile phone tablet",perm_identity:"account avatar face human information people person profile save, thumbnail user",perm_media:"collection data directories document file folders images landscape mountains photography picture save storage",perm_phone_msg:"bubble call cell chat comment communicate contact device message mobile recording save speech telephone voice",perm_scan_wifi:"alert announcement connection information internet network service signal wireless",person:"account avatar face human people profile user",person_add:"+ account avatar face friend human new people plus profile symbol user",person_add_alt:"+ account face human people plus profile user",person_add_disabled:"+ account enabled face human new offline people plus profile slash symbol user",personal_video:"Android cam chrome desktop device hardware iOS mac monitor television tv web window",person_off:"account avatar disabled enabled face human people profile slash user",person_outline:"account avatar face human people profile user",person_pin:"account avatar destination direction face gps human location maps people place profile stop user",person_pin_circle:"account destination direction face gps human location maps people place profile stop user",person_remove:"account avatar delete face human minus people profile unfriend user",person_search:"account avatar face find glass human look magnifying people profile user",pest_control:"bug exterminator insects",pest_control_rodent:"exterminator mice",pets:"animal cat claw dog hand paw",phishing:"fishing fraud hook scam",phone:"call cell chat contact device hardware mobile telephone text",phone_android:"cell device hardware iOS mobile tablet",phone_bluetooth_speaker:"call cell connection connectivity contact device hardware mobile signal symbol telephone wireless",phone_callback:"arrow cell contact device down hardware mobile telephone",phone_disabled:"call cell contact device enabled hardware mobile offline slash telephone",phone_enabled:"call cell contact device hardware mobile telephone",phone_forwarded:"arrow call cell contact device direction hardware mobile right telephone",phone_iphone:"Android apple cell device hardware iOS mobile tablet",phonelink:"Android chrome computer connect desktop device hardware iOS mac mobile sync tablet web windows",phonelink_erase:"Android cancel cell close connection device exit hardware iOS mobile no remove stop tablet",phonelink_lock:"Android cell connection device erase hardware iOS locked mobile password privacy private protection safety secure security tablet",phonelink_off:"Android chrome computer connect desktop device disabled enabled hardware iOS mac mobile slash sync tablet web windows",phonelink_ring:"Android cell connection data device hardware iOS mobile network service signal tablet wireless",phonelink_setup:"Android call chat device hardware iOS information mobile settings tablet text",phone_locked:"call cell contact device hardware mobile password privacy private protection safety secure security telephone",phone_missed:"arrow call cell contact device hardware mobile telephone",phone_paused:"call cell contact device hardware mobile telephone wait",photo:"image mountains photography picture",photo_album:"archive bookmark image label library mountains photography picture ribbon save tag",photo_camera:"image photography picture",photo_camera_back:"image landscape mountains photography picture rear",photo_camera_front:"account face human image people person photography picture portrait profile user",photo_filter:"filters image photography picture stars",photo_library:"album image mountains photography picture",photo_size_select_actual:"image mountains photography picture",photo_size_select_large:"adjust album editing image library mountains photography picture",photo_size_select_small:"adjust album editing image large library mountains photography picture",php:"alphabet brackets character code css developer engineering font html letter platform symbol text type",piano:"instrument keyboard keys musical social",piano_off:"disabled enabled instrument keyboard keys musical on slash social",picture_as_pdf:"alphabet character document file font image letter multiple photography symbol text type",picture_in_picture:"cropped overlap photo position shape",picture_in_picture_alt:"cropped overlap photo position shape",pie_chart:"analytics bars data diagram infographic measure metrics statistics tracking",pie_chart_outline:"analytics bars data diagram infographic measure metrics statistics tracking",pie_chart_outlined:"graph",pin:"1 2 3 digit key login logout number password pattern security star symbol unlock",pinch:"arrows compress direction finger grasp hand navigation nip squeeze tweak",pin_drop:"destination direction gps location maps navigation place stop",pinterest:"brand logo social",pivot_table_chart:"analytics arrows bars data diagram direction drive editing grid infographic measure metrics rotate sheet statistics tracking",pix:"bill brazil card cash commerce credit currency finance money payment",place:"destination direction location maps navigation pin point stop",plagiarism:"document find glass look magnifying page paper search see",play_arrow:"controls media music player start video",play_circle:"arrow controls media music video",play_circle_filled:"arrow controls media music start video",play_circle_filled_white:"start",play_circle_outline:"arrow controls media music start video",play_disabled:"controls enabled media music off slash video",play_for_work:"arrow circle down google half",play_lesson:"audio bookmark digital ebook lesson multimedia play reading ribbon",playlist_add:"+ collection music new plus symbol task todo",playlist_add_check:"approve checkmark collection complete done music ok select task tick todo validate verified yes",playlist_add_check_circle:"album artist audio cd collection mark music record sound track",playlist_add_circle:"album artist audio cd check collection mark music record sound track",playlist_play:"arow arrow collection music",playlist_remove:"- collection minus music",plumbing:"build construction fix handyman repair tools wrench",plus_one:"1 add digit increase number symbol",podcasts:"broadcast casting network signal transmitting wireless",point_of_sale:"checkout cost machine merchant money payment pos retail system transaction",policy:"certified find glass legal look magnifying privacy private protection search security see shield verified",poll:"analytics barchart bars data diagram infographic measure metrics statistics survey tracking vote",pool:"athlete athletic beach body entertainment exercise hobby human ocean people person places sea sports swimming water",portable_wifi_off:"connected connection data device disabled enabled internet network offline service signal slash usage wireless",portrait:"account face human people person photo picture profile user",post_add:"+ data document drive file folders item page paper plus sheet slide text writing",power:"charge cord electrical online outlet plug socket",power_input:"dc lines supply",power_off:"charge cord disabled electrical enabled on outlet plug slash",power_settings_new:"information off save shutdown",precision_manufacturing:"arm automatic chain conveyor crane factory industry machinery mechanical production repairing robot supply warehouse",pregnant_woman:"baby birth body female human lady maternity mom mother people person user women",present_to_all:"arrow presentation screen share slides website",preview:"design eye layout reveal screen see show website window www",price_change:"arrows bill card cash coin commerce cost credit currency dollars down finance money online payment shopping symbol up",price_check:"approve bill card cash coin commerce complete cost credit currency dollars done finance mark money ok online payment select shopping symbol tick validate verified yes",print:"draft fax ink machine office paper printer send",print_disabled:"enabled off on paper printer slash",priority_high:"! alert attention caution danger error exclamation important mark notification symbol warning",privacy_tip:"alert announcement announcment assistance certified details help information private protection security service shield support verified",production_quantity_limits:"! alert attention bill card cart cash caution coin commerce credit currency danger dollars error exclamation important mark money notification online payment shopping symbol warning",propane:"gas nest",propane_tank:"bbq gas grill nest",psychology:"behavior body brain cognitive function gear head human intellectual mental mind people person preferences psychiatric science settings social therapy thinking thoughts",public:"country earth global globe language map network planet social space web world",public_off:"disabled earth enabled global globe map network on planet slash social space web world",publish:"arrow cloud file import submit upload",published_with_changes:"approve arrows check complete done inprogress loading mark ok refresh renew replace rotate select tick validate verified yes",push_pin:"location marker place remember save",qr_code:"barcode camera media product quick response smartphone urls",qr_code_2:"barcode camera media product quick response smartphone urls",qr_code_scanner:"barcode camera media product quick response smartphone urls",query_builder:"clock date hour minute save schedule time",query_stats:"analytics chart data diagram find glass infographic line look magnifying measure metrics search see statistics tracking",question_answer:"bubble chat comment communicate conversation converse feedback message speech talk",question_mark:"? assistance help information mark punctuation question support symbol",queue:"add collection layers multiple music playlist stack stream video",queue_music:"add collection playlist stream",queue_play_next:"+ add arrow collection desktop device display hardware monitor music new playlist plus screen steam symbol tv video",quickreply:"bubble chat comment communicate fast lightning message speech thunderbolt",quiz:"? assistance faq help information mark punctuation question support symbol test",radar:"detect military near network position scan",radio:"antenna audio device frequency hardware listen media music player signal tune",radio_button_checked:"application bullet circle components design form interface off point record screen selected toggle ui ux website",radio_button_unchecked:"bullet circle deselected form off point record toggle",railway_alert:"! attention automobile bike cars caution danger direction error exclamation important maps mark notification public scooter subway symbol train transportation vehicle vespa warning",ramen_dining:"breakfast dinner drink fastfood lunch meal noodles restaurant",ramp_left:"arrows directions maps navigation path route sign traffic",ramp_right:"arrows directions maps navigation path route sign traffic",rate_review:"chat comment feedback message pencil stars write",raw_off:"alphabet character disabled enabled font image letter original photography slash symbol text type",raw_on:"alphabet character disabled enabled font image letter off original photography slash symbol text type",read_more:"arrow text",receipt:"bill credit invoice paper payment sale transaction",receipt_long:"bill check document list paperwork record store transaction",recent_actors:"account avatar cards carousel contacts face human layers list people person profile thumbnail user",recommend:"approved circle confirm favorite gesture hand like reaction social support thumbs well",record_voice_over:"account face human people person profile recording sound speaking speech transcript user",rectangle:"four parallelograms polygons quadrilaterals recangle shape sides",reddit:"brand logo social",redeem:"bill cart cash certificate coin commerce credit currency dollars giftcard money online payment present shopping",redo:"arrow backward forward next repeat rotate undo",reduce_capacity:"arrow body covid decrease down human people person social",refresh:"around arrows direction inprogress loading navigation refresh renew right rotate turn",remember_me:"Android avatar device hardware human iOS identity mobile people person phone profile tablet user",remove:"can delete line minus negative substract subtract trash",remove_circle:"allowed banned block can delete disable minus negative not substract trash",remove_circle_outline:"allowed banned block can delete disable minus negative not substract trash",remove_done:"approve check complete disabled enabled finished mark multiple off ok select slash tick yes",remove_from_queue:"collection desktop device display hardware list monitor screen steam television",remove_moderator:"certified disabled enabled off privacy private protection security shield slash verified",remove_red_eye:"iris looking preview see sight vision",remove_road:"- cancel close destination direction exit highway maps minus new no stop street symbol traffic",remove_shopping_cart:"card cash checkout coin commerce credit currency disabled dollars enabled off online payment slash tick",reorder:"format lines list stacked",repeat:"arrows controls media music video",repeat_on:"arrows controls media music video",repeat_one:"1 arrows controls digit media music number symbol video",repeat_one_on:"arrows controls digit media music number symbol video",replay:"arrows controls music refresh reload renew repeat retry rewind undo video",replay_10:"arrows controls digit music number refresh renew repeat rewind symbol ten video",replay_30:"arrows controls digit music number refresh renew repeat rewind symbol thirty video",replay_5:"arrows controls digit five music number refresh renew repeat rewind symbol video",replay_circle_filled:"arrows controls music refresh renew repeat video",reply:"arrow backward left mail message send share",reply_all:"arrows backward group left mail message multiple send share",report:"! alert attention caution danger error exclamation important mark notification octagon symbol warning",report_gmailerrorred:"! alert attention caution danger exclamation important mark notification octagon symbol warning",report_off:"! alert attention caution danger disabled enabled error exclamation important mark notification octagon offline slash symbol warning",report_problem:"! alert announcement attention caution danger error exclamation feedback important mark notification symbol triangle warning",request_quote:"bill card cash coin commerce cost credit currency dollars finance money online payment price shopping symbol",reset_tv:"arrow device hardware monitor television",restart_alt:"around arrow inprogress loading reboot refresh renew repeat reset",restaurant:"breakfast cutlery dining dinner eat food fork knife local lunch meal places spoon utensils",restaurant_menu:"book dining eat food fork knife local meal spoon",restore:"arrow backwards clock date history refresh renew reverse rotate schedule time turn undo",restore_from_trash:"arrow backwards can clock date delete garbage history refresh remove renew reverse rotate schedule time turn up",restore_page:"arrow data doc file history paper refresh rotate sheet storage undo web",reviews:"bubble chat comment communicate feedback message rate rating recommendation speech",rice_bowl:"dinner food lunch meal restaurant",ring_volume:"calling cell contact device hardware incoming mobile ringer sound telephone",r_mobiledata:"alphabet character font letter symbol text type",rocket:"spaceship",rocket_launch:"spaceship takeoff",roller_shades:"blinds cover curtains nest open shutter sunshade",roller_shades_closed:"blinds cover curtains nest shutter sunshade",roofing:"architecture building chimney construction estate home house real residence residential service shelter",room:"destination direction gps location maps marker pin place spot stop",room_preferences:"building doorway entrance gear home house interior office open settings",room_service:"alert bell concierge delivery hotel notify",rotate_90_degrees_ccw:"arrows direction editing image photo turn",rotate_90_degrees_cw:"arrows ccw direction editing image photo turn",rotate_left:"around arrow circle direction inprogress loading refresh reload renew reset turn",rotate_right:"around arrow circle direction inprogress loading refresh renew turn",roundabout_left:"arrows directions maps navigation path route sign traffic",roundabout_right:"arrows directions maps navigation path route sign traffic",rounded_corner:"adjust edit shape square transform",route:"directions maps path sign traffic",router:"box cable connection device hardware internet network signal wifi",rowing:"activity boat body canoe human people person sports water",rss_feed:"application blog connection data internet network service signal website wifi wireless",rsvp:"alphabet character font invitation invite letter plaît respond répondez sil symbol text type vous",rtt:"call real rrt text time",rule:"approve check done incomplete line mark missing no ok select tick validate verified wrong x yes",rule_folder:"approve cancel check close complete data document done drive exit file mark no ok remove select sheet slide storage tick validate verified yes",run_circle:"body exercise human people person running",running_with_errors:"! alert attention caution danger duration exclamation important mark notification processing symbol time warning",rv_hookup:"arrow attach automobile automotive back cars connect direction left maps public right trailer transportation travel truck van vehicle",safety_divider:"apart distance separate social space",sailing:"entertainment fishing hobby ocean sailboat sea social sports travel water",sanitizer:"bacteria bottle clean covid disinfect germs pump",satellite:"bluetooth connection connectivity data device image internet landscape location maps mountains network photography picture scan service signal symbol wifi wireless--",satellite_alt:"alternative artificial communication space station television",save:"data diskette document drive file floppy multimedia storage write",save_alt:"arrow diskette document down file floppy multimedia write",save_as:"compose create data disk document draft drive editing file floppy input multimedia pencil storage write writing",saved_search:"find glass important look magnifying marked see star",savings:"bank bill card cash coin commerce cost credit currency dollars finance money online payment piggy symbol",scale:"measure monitor weight",scanner:"copy device hardware machine",scatter_plot:"analytics bars chart circles data diagram dot infographic measure metrics statistics tracking",schedule:"calendar clock date mark save time",schedule_send:"calendar clock date email letter remember share time",schema:"analytics chart data diagram flow infographic measure metrics statistics tracking",school:"academy achievement cap class college education graduation hat knowledge learning university",science:"beaker chemical chemistry experiment flask glass laboratory research tube",score:"2k alphabet analytics bars character chart data diagram digit font infographic letter measure metrics number statistics symbol text tracking type",screen_lock_landscape:"Android device hardware iOS mobile phone rotate security tablet",screen_lock_portrait:"Android device hardware iOS mobile phone rotate security tablet",screen_lock_rotation:"Android arrow device hardware iOS mobile phone rotate tablet turn",screen_rotation:"Android arrow device hardware iOS mobile phone rotate tablet turn",screen_search_desktop:"Android arrow device hardware iOS lock monitor rotate web",screen_share:"Android arrow cast chrome device display hardware iOS laptop mac mirror monitor steam streaming web window",screenshot:"Android cell crop device hardware iOS mobile phone tablet",screenshot_monitor:"Android chrome desktop device display hardware iOS mac screengrab web window",sd:"alphabet camera card character data device digital drive flash font image letter memory photo secure symbol text type",sd_card:"camera digital memory photos secure storage",sd_card_alert:"! attention camera caution danger digital error exclamation important mark memory notification photos secure storage symbol warning",sd_storage:"camera card data digital memory microsd secure",search:"filter find glass look magnifying see up",search_off:"cancel close disabled enabled find glass look magnifying on see slash stop x",security:"certified privacy private protection shield verified",security_update:"Android arrow device download hardware iOS mobile phone tablet",security_update_good:"Android checkmark device hardware iOS mobile ok phone tablet tick",security_update_warning:"! Android alert attention caution danger device download error exclamation hardware iOS important mark mobile notification phone symbol tablet",segment:"alignment fonts format lines list paragraph part piece rules style text",select_all:"selection square tool",self_improvement:"body calm care chi human meditate meditation people person relax sitting wellbeing yoga zen",sell:"bill card cart cash coin commerce credit currency dollars money online payment price shopping tag",send:"chat email message paper plane reply right share telegram",send_and_archive:"arrow download email letter save share",send_time_extension:"deliver dispatch envelop mail message schedule",send_to_mobile:"Android arrow device export forward hardware iOS phone right share tablet",sensors:"connection network scan signal wireless",sensors_off:"connection disabled enabled network scan signal slash wireless",sentiment_dissatisfied:"angry disappointed dislike emoji emoticon emotions expressions face feelings frown mood person sad smiley survey unhappy unsatisfied upset",sentiment_neutral:"emotionless emotions expressions face feelings indifference mood okay person survey",sentiment_satisfied:"emoji emoticon emotions expressions face feelings glad happiness happy like mood person pleased smiley smiling survey",sentiment_satisfied_alt:"account emoji face happy human people person profile smile user",sentiment_very_dissatisfied:"angry disappointed dislike emoji emoticon emotions expressions face feelings mood person sad smiley sorrow survey unhappy unsatisfied upset",sentiment_very_satisfied:"emoji emoticon emotions expressions face feelings glad happiness happy like mood person pleased smiley smiling survey",set_meal:"chopsticks dinner fish food lunch restaurant teishoku",settings:"application change details gear information options personal service",settings_accessibility:"body details human information people personal preferences profile user",settings_applications:"change details gear information options personal save service",settings_backup_restore:"arrow backwards history refresh reverse rotate time undo",settings_bluetooth:"connection connectivity device network signal symbol wifi",settings_brightness:"dark filter light mode sun",settings_cell:"Android cellphone device hardware iOS mobile tablet",settings_ethernet:"arrows brackets computer connection connectivity dots internet network parenthesis wifi",settings_input_antenna:"airplay arrows computer connection connectivity dots internet network screencast stream wifi wireless",settings_input_component:"audio av cables connection connectivity internet plugs points video wifi",settings_input_composite:"cable component connection connectivity plugs points",settings_input_hdmi:"cable connection connectivity definition high plugin points video wire",settings_input_svideo:"cable connection connectivity definition plugin plugs points standard svideo,",settings_overscan:"arrows expand image photo picture",settings_phone:"call cell contact device hardware mobile telephone",settings_power:"information off save shutdown",settings_remote:"bluetooth connection connectivity control device signal wifi wireless",settings_suggest:"change details gear options recommendation service suggestion system",settings_system_daydream:"backup cloud drive storage",settings_voice:"microphone recorder speaker",seven_k:"7000 7K alphabet character digit display font letter number pixels resolution symbol text type video",seven_k_plus:"+ 7000 7K alphabet character digit display font letter number pixels resolution symbol text type video",seven_mp:"camera digit font image letters megapixels number quality resolution symbol text type",seventeen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",share:"android connect contect link multimedia multiple network options send shared sharing social",share_location:"destination direction gps maps pin place stop tracking",shield:"certified privacy private protection secure security verified",shop:"arrow bag bill briefcase buy card cart cash coin commerce credit currency dollars google money online payment play purchase shopping store",shop_2:"add arrow buy cart google play purchase shopping",shopping_bag:"bill business buy card cart cash coin commerce credit currency dollars money online payment storefront",shopping_basket:"add bill buy card cart cash checkout coin commerce credit currency dollars money online payment purchase",shopping_cart:"add bill buy card cash checkout coin commerce credit currency dollars money online payment purchase",shopping_cart_checkout:"arrow cash coin commerce currency dollars money online payment right",shop_two:"add arrow briefcase buy cart google play purchase shopping",shortcut:"arrow direction forward right",short_text:"brief comment document lines note write writing",show_chart:"analytics bars chart data diagram infographic line measure metrics presentation show statistics stock tracking",shower:"bathroom closet home house place plumbing sprinkler wash water wc",shuffle:"arrows controls music random video",shuffle_on:"arrows controls music random video",shutter_speed:"aperture camera duration image lens photography photos picture setting stop timer watch",sick:"covid discomfort emotions expressions face feelings fever flu ill mood pain person survey upset",signal_cellular_0_bar:"data internet mobile network phone speed wifi wireless",signal_cellular_4_bar:"data internet mobile network phone speed wifi wireless",signal_cellular_alt:"analytics bar chart data diagram infographic internet measure metrics mobile network phone statistics tracking wifi wireless",signal_cellular_connected_no_internet_0_bar:"! alert attention caution danger data error exclamation important mark mobile network notification phone symbol warning wifi wireless",signal_cellular_connected_no_internet_1_bar:"network",signal_cellular_connected_no_internet_2_bar:"network",signal_cellular_connected_no_internet_3_bar:"network",signal_cellular_connected_no_internet_4_bar:"! alert attention caution danger data error exclamation important mark mobile network notification phone symbol warning wifi wireless",signal_cellular_nodata:"internet mobile network offline phone quit wifi wireless x",signal_cellular_no_sim:"camera card chip device disabled enabled memory network offline phone slash storage",signal_cellular_null:"data internet mobile network phone wifi wireless",signal_cellular_off:"data disabled enabled internet mobile network offline phone slash wifi wireless",signal_wifi_bad:"bar cancel cellular close data exit internet mobile network no phone quit remove stop wireless",signal_wifi_connected_no_internet4:"cellular data mobile network offline phone wireless x",signal_wifi_off:"cellular data disabled enabled internet mobile network phone slash speed wireless",signal_wifi_statusbar4_bar:"cellular data internet mobile network phone speed wireless",signal_wifi_statusbar_connected_no_internet4:"! alert attention caution cellular danger data error exclamation important mark mobile network notification phone speed symbol warning wireless",signal_wifi_statusbar_null:"cellular data internet mobile network phone speed wireless",signpost:"arrow direction left maps right signal signs street traffic",sim_card:"camera chip device memory network phone storage",sim_card_alert:"! attention camera caution danger digital error exclamation important mark memory notification photos sd secure storage symbol warning",sim_card_download:"arrow camera chip device memory phone storage",single_bed:"bedroom double furniture home hotel house king night pillows queen rest sleep twin",sip:"alphabet call character dialer font initiation internet letter over phone protocol routing session symbol text type voice",six_k:"6000 6K alphabet character digit display font letter number pixels resolution symbol text type video",six_k_plus:"+ 6000 6K alphabet character digit display font letter number pixels resolution symbol text type video",six_mp:"camera digit font image letters megapixels number quality resolution symbol text type",sixteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",sixty_fps:"camera digit frames number symbol video",sixty_fps_select:"camera digits frame frequency numbers per rate seconds video",skateboarding:"athlete athletic body entertainment exercise hobby human people person skateboarder social sports",skip_next:"arrow back controls forward music play previous transport video",skip_previous:"arrow backward controls forward music next play transport video",sledding:"athlete athletic body entertainment exercise hobby human people person sledge snow social sports travel winter",slideshow:"movie photos play presentation square video view",slow_motion_video:"arrow circle controls music play speed time",smart_button:"action auto components composer function interface special stars ui ux website",smart_display:"airplay chrome connect device screencast stream television tv video wireless",smartphone:"Android call cell chat device hardware iOS mobile tablet text",smart_screen:"Android airplay cell connect device hardware iOS mobile phone screencast stream tablet video",smart_toy:"games robot",smoke_free:"cigarette disabled enabled never no off places prohibited slash smoking tobacco warning zone",smoking_rooms:"allowed cigarette places smoke tobacco zone",sms:"3 bubble chat comment communication conversation dots message more service speech three",sms_failed:"! alert attention bubbles caution chat comment communication conversation danger error exclamation important mark message notification service speech symbol warning",snippet_folder:"data document drive file sheet slide storage",snooze:"alarm bell clock duration notification set timer watch",snowboarding:"athlete athletic body entertainment exercise hobby human people person social sports travel winter",snowmobile:"automobile car direction skimobile social sports transportation travel vehicle winter",snowshoeing:"body human people person sports travel walking winter",soap:"bathroom clean fingers gesture hand wash wc",social_distance:"6 apart body ft human people person space",solar_power:"eco energy heat nest sunny",sort:"filter find lines list organize",sort_by_alpha:"alphabetize az by character font letters list order organize symbol text type",soup_kitchen:"breakfast brunch dining food lunch meal",source:"code composer content creation data document file folder mode storage view",south:"arrow directional down maps navigation",south_america:"america continent landscape place region south",south_east:"arrow directional down maps navigation right",south_west:"arrow directional down left maps navigation",spa:"aromatherapy flower healthcare leaf massage meditation nature petals places relax wellbeing wellness",space_bar:"keyboard line",speaker:"audio box electronic loud music sound stereo system video",speaker_group:"audio box electronic loud multiple music sound stereo system video",speaker_notes:"bubble cards chat comment communicate format list message speech text",speaker_notes_off:"bubble cards chat comment communicate disabled enabled format list message on slash speech text",speaker_phone:"Android cell device hardware iOS mobile sound tablet volume",speed:"arrow clock controls dial fast gauge measure motion music slow speedometer test velocity video",spellcheck:"alphabet approve character checkmark edit font letter ok processor select symbol text tick type word write yes",splitscreen:"grid layout multitasking two",spoke:"connection network radius",sports:"athlete athletic basketball blowing coach entertainment exercise game hobby instrument live referee soccer social sound trophy warning whistle",sports_bar:"alcohol beer drink liquor pint places pub",sports_baseball:"athlete athletic entertainment exercise game hobby social",sports_basketball:"athlete athletic entertainment exercise game hobby social",sports_cricket:"athlete athletic ball bat entertainment exercise game hobby social",sports_esports:"controller entertainment gamepad gaming hobby online playstation social video xbox",sports_football:"american athlete athletic entertainment exercise game hobby social",sports_golf:"athlete athletic ball club entertainment exercise game golfer golfing hobby social",sports_handball:"athlete athletic body entertainment exercise game hobby human people person social",sports_hockey:"athlete athletic entertainment exercise game hobby ice social sticks",sports_kabaddi:"athlete athletic body combat entertainment exercise fighting game hobby human judo martial people person social wrestle wrestling",sports_martial_arts:"athlete athletic entertainment exercise hobby human karate people person social",sports_mma:"arts athlete athletic boxing combat entertainment exercise fighting game glove hobby martial mixed social",sports_motorsports:"athlete athletic automobile bike drive driving entertainment helmet hobby motorcycle protect social vehicle",sports_rugby:"athlete athletic ball entertainment exercise game hobby social",sports_score:"destination flag goal",sports_soccer:"athlete athletic entertainment exercise football game hobby social",sports_tennis:"athlete athletic ball bat entertainment exercise game hobby racket social",sports_volleyball:"athlete athletic entertainment exercise game hobby social",square:"draw four quadrangle shape sides",square_foot:"construction feet inches length measurement ruler school set tools",ssid_chart:"graph lines network wifi",stacked_bar_chart:"analytics chart-chart data diagram infographic measure metrics statistics tracking",stacked_line_chart:"analytics data diagram infographic measure metrics statistics tracking",stadium:"activity amphitheater arena coliseum event local star things ticket",stairs:"down staircase up",star:"best bookmark favorite highlight ranking rate rating save toggle",star_border:"best bookmark favorite highlight outline ranking rate rating save toggle",star_border_purple_500:"best bookmark favorite highlight outline ranking rate rating save toggle",star_half:"0.5 1/2 achievement bookmark favorite highlight important marked ranking rate rating reward saved shape special toggle",star_outline:"bookmark favorite half highlight ranking rate rating save toggle",star_purple_500:"best bookmark favorite highlight ranking rate rating save toggle",star_rate:"achievement bookmark favorite highlight important marked ranking rating reward saved shape special",stars:"achievement bookmark circle favorite highlight important like love marked ranking rate rating reward saved shape special",start:"arrow keyboard next right",stay_current_landscape:"Android device hardware iOS mobile phone tablet",stay_current_portrait:"Android device hardware iOS mobile phone tablet",stay_primary_landscape:"Android current device hardware iOS mobile phone tablet",stay_primary_portrait:"Android current device hardware iOS mobile phone tablet",sticky_note_2:"bookmark message paper text writing",stop:"arrow controls music pause player square video",stop_circle:"controls music pause play square video",stop_screen_share:"Android arrow cast chrome device disabled display enabled hardware iOS laptop mac mirror monitor offline slash steam streaming web window",storage:"computer database drive memory network server",store:"bill building business buy card cash coin company credit currency dollars e-commerce market money online payment purchase shopping storefront",storefront:"business buy cafe commerce market merchant places restaurant retail sell shopping stall",store_mall_directory:"building",storm:"forecast hurricane temperature twister weather wind",straight:"arrows directions maps navigation path route sign traffic up",straighten:"length measurement piano ruler size",stream:"cast connected feed live network signal wireless",streetview:"gps location maps",strikethrough_s:"alphabet character cross doc editing editor font letter out spreadsheet styles symbol text type writing",stroller:"baby care carriage children infant kid newborn toddler young",style:"booklet cards filters options tags",subdirectory_arrow_left:"arrow down navigation",subdirectory_arrow_right:"arrow down navigation",subject:"alignment document email full justify lines list note text writing",subscript:"2 doc editing editor gmail novitas spreadsheet style symbol text writing",subscriptions:"enroll media order playlist queue signup subscribe youtube",subtitles:"accessibility accessible captions character closed decoder language media movies translate tv",subtitles_off:"accessibility accessible caption closed disabled enabled language slash translate video",subway:"automobile bike cars maps metro rail scooter train transportation travel tunnel underground vehicle vespa",summarize:"document list menu note report summary",superscript:"2 doc editing editor gmail novitas spreadsheet style symbol text writing",supervised_user_circle:"account avatar control face human parental parents people person profile supervisor",supervisor_account:"administrator avatar control face human parental parents people person profile supervised user",support:"assist help lifebuoy rescue safety",support_agent:"care customer face headphone person representative service",surfing:"athlete athletic beach body entertainment exercise hobby human people person sea social sports summer water",surround_sound:"audio circle signal speaker system volume volumn wireless",swap_calls:"arrows device direction mobile share",swap_horiz:"arrows back direction forward horizontal",swap_horizontal_circle:"arrows back direction forward",swap_vert:"arrows back direction down navigation up vertical",swap_vertical_circle:"arrows back direction down horizontal up",swipe:"arrows fingers gesture hands touch",swipe_down:"arrows direction disable enable finger hands hit navigation strike swing swpie take",swipe_down_alt:"arrows direction disable enable finger hands hit navigation strike swing swpie take",swipe_left:"arrows finger hand hit navigation reject strike swing take",swipe_left_alt:"arrows finger hand hit navigation reject strike swing take",swipe_right:"accept arrows direction finger hands hit navigation strike swing swpie take",swipe_right_alt:"accept arrows direction finger hands hit navigation strike swing swpie take",swipe_up:"arrows direction disable enable finger hands hit navigation strike swing swpie take",swipe_up_alt:"arrows direction disable enable finger hands hit navigation strike swing swpie take",swipe_vertical:"arrows direction finger hands hit navigation strike swing swpie take verticle",switch_access_shortcut:"arrows direction navigation new north star symbol up",switch_access_shortcut_add:"+ arrows direction navigation new north plus star symbol up",switch_account:"choices face human multiple options people person profile social user",switch_camera:"arrows photography picture",switch_left:"arrows directional navigation toggle",switch_right:"arrows directional navigation toggle",switch_video:"arrows camera photography videos",sync:"360 around arrows direction inprogress loading refresh renew rotate turn",sync_alt:"arrows horizontal internet technology update wifi",sync_disabled:"360 around arrows direction enabled inprogress loading off refresh renew rotate slash turn",sync_lock:"around arrows locked password privacy private protection renew rotate safety secure security turn",sync_problem:"! 360 alert around arrows attention caution danger direction error exclamation important inprogress loading mark notification refresh renew rotate symbol turn warning",system_security_update:"Android arrow cell device down hardware iOS mobile phone tablet",system_security_update_good:"Android approve cell check complete device done hardware iOS mark mobile ok phone select tablet tick validate verified yes",system_security_update_warning:"! Android alert attention caution cell danger device error exclamation hardware iOS important mark mobile notification phone symbol tablet",system_update:"Android arrows cell device direction download hardware iOS install mobile phone tablet",system_update_alt:"arrow download export",tab:"browser computer documents folder internet tabs website windows",table_chart:"analytics bars data diagram grid infographic measure metrics statistics tracking",table_rows:"grid layout lines stacked",tablet:"Android device hardware iOS ipad mobile web",tablet_android:"device hardware iOS ipad mobile web",tablet_mac:"Android apple device hardware iOS ipad mac mobile tablet web",table_view:"format grid group layout multiple",tab_unselected:"browser computer documents folder internet tabs website windows",tag:"hashtag key media number pound social trend",tag_faces:"emoji emotion happy satisfied smile",takeout_dining:"box container delivery food meal restaurant",tap_and_play:"Android cell connection device hardware iOS internet mobile network nfc phone signal tablet to wifi wireless",tapas:"appetizer brunch dinner food lunch restaurant snack",task:"approve check complete data document done drive file folders mark ok page paper select sheet slide tick validate verified writing yes",task_alt:"approve check circle complete done mark ok select tick validate verified yes",taxi_alert:"! attention automobile cab cars caution danger direction error exclamation important lyft maps mark notification public symbol transportation uber vehicle warning yellow",telegram:"brand call chat logo messaging voice",ten_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",terminal:"application code emulator program software",terrain:"geography landscape mountain",text_decrease:"- alphabet character font letter minus remove resize subtract symbol type",text_fields:"T add alphabet character font input letter symbol type",text_format:"A alphabet character font letter square style symbol type",text_increase:"+ add alphabet character font letter new plus resize symbol type",text_rotate_up:"A alphabet arrow character field font letter move symbol type",text_rotate_vertical:"A alphabet arrow character down field font letter move symbol type verticle",text_rotation_angledown:"A alphabet arrow character field font letter move rotate symbol type",text_rotation_angleup:"A alphabet arrow character field font letter move rotate symbol type",text_rotation_down:"A alphabet arrow character field font letter move rotate symbol type",text_rotation_none:"A alphabet arrow character field font letter move rotate symbol type",textsms:"bubble chat comment communicate dots feedback message speech",text_snippet:"data document file notes storage writing",texture:"diagonal lines pattern stripes",theater_comedy:"broadway event movie musical places show standup tour watch",theaters:"film media movies photography showtimes video watch",thermostat:"forecast temperature weather",thermostat_auto:"A celsius fahrenheit temperature thermometer",thirteen_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",thirty_fps:"alphabet camera character digit font frames letter number symbol text type video",thirty_fps_select:"camera digits frame frequency image numbers per rate seconds video",three_d_rotation:"3d D alphabet arrows av camera character digit font letter number symbol text type vr",three_g_mobiledata:"alphabet cellular character digit font letter network number phone signal speed symbol text type wifi",three_k:"3000 3K alphabet character digit display font letter number pixels resolution symbol text type video",three_k_plus:"+ 3000 3K alphabet character digit display font letter number pixels resolution symbol text type video",three_mp:"camera digit font image letters megapixels number quality resolution symbol text type",three_p:"account avatar bubble chat comment communicate face human message party people person profile speech user",three_sixty:"arrow av camera direction rotate rotation vr",thumb_down:"dislike downvote favorite fingers gesture hands ranking rate rating reject up",thumb_down_alt:"bad decline disapprove dislike feedback hand hate negative no reject social veto vote",thumb_down_off_alt:"bad decline disapprove dislike favorite feedback filled fingers gesture hands hate negative no ranking rate rating reject sad social veto vote",thumbs_up_down:"dislike favorite fingers gesture hands rate rating vote",thumb_up:"approve dislike down favorite fingers gesture hands ranking rate rating success upvote",thumb_up_alt:"agreed approved confirm correct favorite feedback good hand happy like okay positive satisfaction social success vote yes",thumb_up_off_alt:"agreed approved confirm correct favorite feedback fingers gesture good hands happy like okay positive ranking rate rating satisfaction social vote yes",timelapse:"duration motion photo timer video",timeline:"analytics chart data graph history line movement points tracking trending zigzag zigzap",timer:"alarm alart bell clock disabled duration enabled notification off slash stopwatch wait",timer_10:"digits duration numbers seconds",timer_10_select:"alphabet camera character digit font letter number seconds symbol text type",timer_3:"digits duration numbers seconds",timer_3_select:"alphabet camera character digit font letter number seconds symbol text type",timer_off:"alarm alart bell clock disabled duration enabled notification slash stopwatch",times_one_mobiledata:"alphabet cellular character digit font letter network number phone signal speed symbol text type wifi",time_to_leave:"automobile cars destination direction drive estimate eta maps public transportation travel trip vehicle",tips_and_updates:"alert announcement electricity idea information lamp lightbulb stars",title:"T alphabet character font header letter subject symbol text type",toc:"content format lines list reorder stacked table text titles",today:"agenda calendar date event mark month range remember reminder schedule time week",toggle_off:"application components configuration control design disable inable inactive interface selection settings slider switch ui ux website",toggle_on:"application components configuration control design disable inable inactive interface off selection settings slider switch ui ux website",token:"badge hexagon mark shield sign symbol",toll:"bill booth card cash circles coin commerce credit currency dollars highway money online payment ticket",tonality:"circle editing filter image photography picture",topic:"data document drive file folder sheet slide storage",tornado:"crisis disaster natural rain storm weather wind",touch_app:"arrow command fingers gesture hand press swipe tap",tour:"destination flag places travel visit",toys:"car fan games kids windmill",track_changes:"bullseye circle evolve lines movement radar rotate shift target",traffic:"direction light maps signal street",train:"automobile cars direction maps public rail subway transportation vehicle",tram:"automobile cars direction maps public rail subway train transportation vehicle",transfer_within_a_station:"arrows body direction human left maps people person public right route stop transit transportation vehicle walk",transform:"adjust crop editing image photo picture",transgender:"female lgbt neutral neutrual social symbol",transit_enterexit:"arrow direction maps navigation route transportation",translate:"alphabet language letter speaking speech text translator words",travel_explore:"earth find glass global globe look magnifying map network planet search see social space web world",trending_down:"analytics arrow change chart data diagram infographic measure metrics movement rate rating sale statistics tracking",trending_flat:"arrow change chart data graph metric movement rate right tracking",trending_up:"analytics arrow change chart data diagram infographic measure metrics movement rate rating statistics tracking",trip_origin:"circle departure",try:"bookmark bubble chat comment communicate favorite feedback highlight important marked message saved shape special speech star",tty:"call cell contact deaf device hardware impaired mobile speech talk telephone text",tune:"adjust editing options settings sliders",tungsten:"electricity indoor lamp lightbulb setting",turned_in:"archive bookmark favorite item label library reading remember ribbon save submit tag",turned_in_not:"archive bookmark favorite item label library outline reading remember ribbon save submit tag",turn_left:"arrows directions maps navigation path route sign traffic",turn_right:"arrows directions maps navigation path route sign traffic",turn_sharp_left:"arrows directions maps navigation path route sign traffic",turn_sharp_right:"arrows directions maps navigation path route sign traffic",turn_slight_left:"arrows directions maps navigation path right route sign traffic",turn_slight_right:"arrows directions maps navigation path route sharp sign traffic",tv:"device display linear living monitor room screencast stream television video wireless",tv_off:"Android chrome desktop device disabled enabled hardware iOS mac monitor slash television web window",twelve_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twenty_four_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twenty_one_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twenty_three_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twenty_two_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twenty_zero_mp:"camera digits font image letters megapixels numbers quality resolution symbol text type",twitter:"brand logo social",two_k:"2000 2K alphabet character digit display font letter number pixels resolution symbol text type video",two_k_plus:"+ alphabet character digit font letter number symbol text type",two_mp:"camera digit font image letters megapixels number quality resolution symbol text type",two_wheeler:"automobile bicycle cars direction maps moped motorbike motorcycle public ride riding scooter transportation travel twom vehicle wheeler wheels",umbrella:"beach protection rain sunny",unarchive:"arrow inbox mail store undo up",undo:"arrow backward mail previous redo repeat rotate",unfold_less:"arrows chevron collapse direction expandable inward list navigation up",unfold_more:"arrows chevron collapse direction down expandable list navigation",unpublished:"approve check circle complete disabled done enabled mark off ok select slash tick validate verified yes",unsubscribe:"cancel close email envelop esubscribe message newsletter off remove send",upcoming:"alarm calendar mail message notification",update:"arrow backwards clock forward future history load refresh reverse rotate schedule time",update_disabled:"arrow backwards clock enabled forward history load off on refresh reverse rotate schedule slash time",upgrade:"arrow export instal line replace update",upload:"arrows download drive",upload_file:"arrow data document download drive folders page paper sheet slide writing",usb:"cable connection device wire",usb_off:"cable connection device wire",u_turn_left:"arrows directions maps navigation path route sign traffic u-turn",u_turn_right:"arrows directions maps navigation path route sign traffic u-turn",vaccines:"aid covid doctor drug emergency hospital immunity injection medical medication medicine needle pharmacy sick syringe vaccination vial",verified:"approve badge burst check complete done mark ok select star tick validate yes",verified_user:"approve audit certified checkmark complete done ok privacy private protection security select shield tick validate yes",vertical_align_bottom:"alignment arrow doc down editing editor spreadsheet text type writing",vertical_align_center:"alignment arrow doc down editing editor spreadsheet text type up writing",vertical_align_top:"alignment arrow doc editing editor spreadsheet text type up writing",vertical_shades:"blinds cover curtains nest open shutter sunshade",vertical_shades_closed:"blinds cover curtains nest roller shutter sunshade",vertical_split:"design format grid layout paragraph text website writing",vibration:"Android alert cell device hardware iOS mobile mode motion notification phone silence silent tablet vibrate",video_call:"+ add camera chat conference filming hardware image motion new picture plus screen symbol videography",videocam:"camera chat conference filming hardware image motion picture screen videography",video_camera_back:"image landscape mountains photography picture rear",video_camera_front:"account face human image people person photography picture profile user",videocam_off:"camera chat conference disabled enabled filming hardware image motion offline picture screen slash videography",video_file:"camera document filming hardware image motion picture videography",videogame_asset:"console controller device gamepad gaming nintendo playstation xbox",videogame_asset_off:"console controller device disabled enabled gamepad gaming playstation slash",video_label:"device item screen window",video_library:"arrow collection play",video_settings:"change details gear information options play screen service window",video_stable:"filming recording setting stability taping",view_agenda:"blocks cards design format grid layout website,stacked",view_array:"blocks design format grid layout website",view_carousel:"banner blocks cards design format grid images layout website",view_column:"blocks design format grid layout vertical website",view_comfy:"grid layout pattern squares",view_comfy_alt:"cozy design format layout web",view_compact:"grid layout pattern squares",view_compact_alt:"dense design format layout web",view_cozy:"comfy design format layout web",view_day:"blocks calendar cards carousel design format grid layout website week",view_headline:"blocks design format grid layout paragraph text website",view_in_ar:"3d augmented cube daydream headset reality square vr",view_kanban:"grid layout pattern squares",view_list:"blocks design format grid layout lines reorder stacked title website",view_module:"blocks design format grid layout reorder squares stacked title website",view_quilt:"blocks design format grid layout reorder squares stacked title website",view_sidebar:"design format grid layout web",view_stream:"blocks design format grid layout lines list reorder stacked title website",view_timeline:"grid layout pattern squares",view_week:"bars blocks columns day design format grid layout website",vignette:"border editing effect filter gradient image photography setting",villa:"architecture beach estate home house maps place real residence residential stay traveling vacation",visibility:"eye on password preview reveal see shown visability",visibility_off:"disabled enabled eye hidden invisible on password reveal see show slash view visability",voice_chat:"bubble camera comment communicate facetime feedback message speech video",voicemail:"call device message missed mobile phone recording",voice_over_off:"account disabled enabled face human people person profile recording slash speaking speech transcript user",volume_down:"audio av control music quieter shh soft sound speaker tv",volume_mute:"audio control music sound speaker tv",volume_off:"audio av control disabled enabled low music mute slash sound speaker tv",volume_up:"audio control music sound speaker tv",volunteer_activism:"donation fingers gesture giving hands heart love sharing",vpn_key:"login network passcode password register security signin signup unlock",vpn_key_off:"[offline] disabled enabled network on passcode password slash unlock",vpn_lock:"earth globe locked network password privacy private protection safety secure security virtual world",vrpano:"angle image landscape mountains panorama photography picture view wide",wallpaper:"background image landscape photography picture",warehouse:"garage industry manufacturing storage",warning:"! alert announcement attention caution danger error exclamation feedback important mark notification problem symbol triangle",warning_amber:"! alert attention caution danger error exclamation important mark notification symbol triangle",wash:"bathroom clean fingers gesture hand wc",watch:"Android clock gadget iOS smartwatch time vr wearables web wristwatch",watch_later:"clock date hour minute schedule time",watch_off:"Android clock close gadget iOS shut time vr wearables web wristwatch",water:"aqua beach lake ocean river waves weather",water_damage:"architecture building droplet estate house leak plumbing real residence residential shelter",waterfall_chart:"analytics bar data diagram infographic measure metrics statistics tracking",waves:"beach lake ocean pool river sea swim water",wb_auto:"A W alphabet automatic balance character editing font image letter photography symbol text type white wp",wb_cloudy:"balance editing white wp",wb_incandescent:"balance bright editing lamp lightbulb lighting settings white wp",wb_iridescent:"balance bright editing lighting settings white wp",wb_shade:"balance house lighting white",wb_sunny:"balance bright lighting weather white",wc:"bathroom closet female gender man person restroom toilet unisex wash water women",web:"blocks browser internet page screen website www",web_asset:"-website application browser design desktop download image interface internet layout screen ui ux video window www",web_asset_off:"browser disabled enabled internet on screen slash webpage website windows www",webhook:"api developer development enterprise software",weekend:"chair couch furniture home living lounge relax room seat",west:"arrow directional left maps navigation",whatshot:"arrow circle direction fire frames round trending",wheelchair_pickup:"accessibility accessible body handicap help human person",where_to_vote:"approve ballot check complete destination direction done election location maps mark ok pin place poll select stop tick validate verified yes",widgets:"app blocks box menu setting squares ui",wifi:"connection data internet network scan service signal wireless",wifi_calling:"cell connection connectivity contact device hardware mobile signal telephone wireless",wifi_calling_3:"cellular data internet mobile network phone speed wireless",wifi_channel:"(scan) [cellular connection data internet mobile] network service signal wireless",wifi_find:"(scan) [cellular connection data detect discover glass internet look magnifying mobile] network notice search service signal wireless",wifi_lock:"cellular connection data internet locked mobile network password privacy private protection safety secure security service signal wireless",wifi_off:"connection data disabled enabled internet network offline scan service signal slash wireless",wifi_password:"(scan) [cellular connection data internet lock mobile] network secure service signal wireless",wifi_protected_setup:"around arrows rotate",wifi_tethering:"cellular connection data internet mobile network phone scan service signal speed wireless",wifi_tethering_off:"cellular connection data disabled enabled internet mobile network offline phone scan service signal slash speed wireless",window:"close glass grid home house interior layout outside",wind_power:"eco energy nest windy",wine_bar:"alcohol cocktail cup drink glass liquor",work:"-briefcase baggage business job suitcase",work_history:"arrow backwards baggage briefcase business clock date job refresh renew reverse rotate schedule suitcase time turn",work_off:"baggage briefcase business disabled enabled job on slash suitcase",work_outline:"baggage briefcase business job suitcase",workspace_premium:"certification degree ecommerce guarantee medal permit ribbon verification",workspaces:"circles collaboration dot filled group team",wrap_text:"arrow doc editing editor spreadsheet type write writing",wrong_location:"cancel close destination direction exit maps no pin place quit remove stop",wysiwyg:"composer mode screen software system text view visibility website window",yard:"backyard flower garden home house nature pettle plants",you_tube:"brand logo social video",youtube_searched_for:"arrow backwards find glass history inprogress loading look magnifying refresh renew restore reverse rotate see yt",zoom_in:"bigger find glass grow look magnifier magnifying plus scale search see size",zoom_in_map:"arrows destination location maps move place stop",zoom_out:"find glass look magnifier magnifying minus negative scale search see size smaller",zoom_out_map:"arrows destination location maps move place stop"},De=new Re({tokenize:"full"});t.iconKeys.forEach(a=>{let r=a;Pe[r]&&(r+=` ${Pe[r]}`),De.addAsync(a,r)});const at=220;process.env.NODE_ENV!=="production"&&Object.keys(Pe).forEach(a=>{t.iconKeys.includes(a)||console.warn(`The icon ${a} no longer exists. Remove it from \`synonyms\``)});function rt({selectedIcon:a="",onIconSelected:r}){const[i,o]=X.useState(null),[c,p]=X.useState(""),l=X.useMemo(()=>t.debounce(m=>{console.log("Searching for",m),!m||m===""?o(null):De.searchAsync(m).then(b=>{o(b)})},at),[]);X.useEffect(()=>(l(c),()=>{l.clear()}),[c,l]);const d=i===null?t.coolIconKeys:i;return e.jsxs(e.Fragment,{children:[e.jsx(t.SearchBar,{autoFocus:!0,className:"w-full sticky top-0 z-10",onTextSearch:m=>p(m??""),placeholder:"Search for more icons…"}),e.jsx("div",{className:"flex max-w-full flex-wrap mt-4",children:d.map(m=>e.jsx(t.Tooltip,{title:m,children:e.jsx(t.IconButton,{shape:"square",toggled:a===m,onClick:()=>r(m),className:"box-content m-1",children:e.jsx(t.Icon,{iconKey:m,size:24})})},m))})]})}function Y({error:a,children:r}){return r?e.jsx(t.Typography,{variant:"caption",color:a?"error":"secondary",className:"ml-3.5 mt-0.5",children:r}):null}function it({isNewCollection:a,reservedGroups:r,existingPaths:i,existingAliases:o,groups:c,parentCollection:p}){const l=g.useRef(null),{values:d,setFieldValue:m,handleChange:b,touched:s,errors:n,setFieldTouched:f,isSubmitting:v,submitCount:y}=u.useFormikContext(),[x,_]=g.useState(!1),k=P=>{m("name",P),!u.getIn(s,"path")&&a&&P&&m("path",t.toSnakeCase(P)),!u.getIn(s,"singularName")&&a&&P&&m("singularName",t.singular(P))},h=t.getIconForView(d),w=g.useCallback(P=>{let M;return P||(M="You must specify a path in the database for this collection"),a&&o?.includes(P.trim().toLowerCase())&&(M="There is already a collection which uses this path as an alias"),a&&i?.includes(P.trim().toLowerCase())&&!d.alias&&(M="There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, you need to define an alias in at least one of the collections"),M},[a,o,i,d.alias]),C=g.useCallback(P=>{if(!P)return;let M;return a&&i?.includes(P.trim().toLowerCase())&&(M="There is already a collection that uses this value as a path"),a&&o?.includes(P.trim().toLowerCase())&&(M="There is already a collection which uses this alias"),M},[a,i,o]),T=c?.filter(P=>!r?.includes(P)),{inputFocused:D,autoCompleteOpen:F,setAutoCompleteOpen:I}=t.useAutoComplete({ref:l}),B=!!p;return e.jsx("div",{className:"overflow-auto my-auto",children:e.jsxs(t.Container,{maxWidth:"4xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-row py-2 pt-3 items-center",children:[e.jsx(t.Typography,{variant:a?"h4":"h5",className:"flex-grow",children:a?"New collection":`${d.name} collection`}),e.jsx(t.Tooltip,{title:"Change icon",children:e.jsx(t.IconButton,{shape:"square",onClick:()=>_(!0),children:h})})]}),p&&e.jsx(t.Chip,{colorScheme:"tealDarker",children:e.jsxs(t.Typography,{variant:"caption",children:["This is a subcollection of ",e.jsx("b",{children:p.name})]})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{value:d.name??"",onChange:P=>k(P.target.value),label:"Name",required:!0,error:s.name&&!!n.name}),e.jsx(Y,{error:s.name&&!!n.name,children:s.name&&n.name?n.name:"Name of in this collection, usually a plural name (e.g. Products)"})]}),e.jsxs("div",{className:t.cn("col-span-12 ",B?"":"sm:col-span-8"),children:[e.jsx(u.Field,{name:"path",as:t.DebouncedTextField,label:"Path",validate:w,disabled:!a,required:!0,error:s.path&&!!n.path}),e.jsx(Y,{error:s.path&&!!n.path,children:s.path&&n.path?n.path:"Path that this collection is stored in"})]}),!B&&e.jsxs("div",{className:"col-span-12 sm:col-span-4 relative",children:[e.jsx(t.TextField,{error:s.group&&!!n.group,disabled:v,value:d.group??"",autoComplete:"off",onChange:P=>m("group",P.target.value),name:"group",inputRef:l,label:"Group"}),e.jsx(t.Autocomplete,{open:F&&(T??[]).length>0,setOpen:I,children:T?.map((P,M)=>e.jsx(t.AutocompleteItem,{onClick:()=>{I(!1),m("group",P??null)},children:e.jsx("div",{className:"flex-grow",children:P})},M+"_"+P))}),e.jsx(Y,{children:s.group&&n.group?n.group:"Group of the collection"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.ExpandablePanel,{title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.SettingsIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"Advanced"})]}),initiallyExpanded:!1,children:e.jsxs("div",{className:"grid grid-cols-12 gap-4 p-4",children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{error:s.singularName&&!!n.singularName,id:"singularName","aria-describedby":"singularName-helper",onChange:P=>(f("singularName",!0),b(P)),value:d.singularName??"",label:"Singular name"}),e.jsx(Y,{error:s.singularName&&!!n.singularName,children:s.singularName&&n.singularName?n.singularName:"Optionally define a singular name for your entities"})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{error:s.description&&!!n.description,id:"description",value:d.description??"",onChange:b,multiline:!0,rows:2,"aria-describedby":"description-helper-text",label:"Description"}),e.jsx(Y,{error:s.description&&!!n.description,children:s.description&&n.description?n.description:"Description of the collection, you can use markdown"})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(u.Field,{name:"alias",as:t.DebouncedTextField,label:"Alias",validate:C,error:s.alias&&!!n.alias}),e.jsx(Y,{error:s.alias&&!!n.alias,children:s.alias&&n.alias?n.alias:"Use an alias as an ID when you have multiple collections located in the same path"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.Select,{name:"defaultSize",label:"Default row size",position:"item-aligned",onChange:b,value:d.defaultSize??"",renderValue:P=>P.toUpperCase(),children:["xs","s","m","l","xl"].map(P=>e.jsx(t.SelectItem,{value:P,children:P.toUpperCase()},`size-select-${P}`))})}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.BooleanSwitchWithLabel,{position:"start",label:"Collection group",onValueChange:P=>m("collectionGroup",P),value:d.collectionGroup??!1}),e.jsx(Y,{children:"A collection group consists of all collections with the same ID. This allows you to query over multiple collections at once."})]})]})})})]}),e.jsx("div",{style:{height:"52px"}}),e.jsx(t.Dialog,{open:x,onOpenChange:_,maxWidth:"xl",fullWidth:!0,children:e.jsx("div",{className:"p-4 overflow-auto min-h-[200px]",children:e.jsx(rt,{selectedIcon:d.icon,onIconSelected:P=>{_(!1),m("icon",P)}})})})]})})}function J(a){return"properties."+a.replaceAll(".",".properties.")}function ot(a){return a?"properties."+a.replaceAll(".",".properties.")+".properties":"properties"}function ae(a){return a?"properties."+a.replaceAll(".",".properties.")+".propertiesOrder":"propertiesOrder"}function H(a,r){return r?`${r}.${a}`:a}const nt=g.memo(function({enumValues:r,onValuesChanged:i,onError:o,updateIds:c,disabled:p,allowDataInference:l,getData:d}){return e.jsx(u.Formik,{initialValues:{enumValues:r},validateOnMount:!0,onSubmit:(m,b)=>{},children:({values:m,errors:b})=>(g.useEffect(()=>{i&&i(m.enumValues)},[m.enumValues]),g.useEffect(()=>{o&&o(!!(b?.enumValues??!1))},[b]),e.jsx(st,{enumValuesPath:"enumValues",values:m,errors:b,shouldUpdateId:c,disabled:p,allowDataInference:l,getData:d}))})},function(r,i){return r.enumValues.length===i.enumValues.length&&r.onValuesChanged===i.onValuesChanged&&r.getData===i.getData});function st({values:a,errors:r,disabled:i,enumValuesPath:o,shouldUpdateId:c,allowDataInference:p,getData:l}){const{setFieldValue:d}=u.useFormikContext(),[m,b]=g.useState(),[s,n]=g.useState(),[f,v]=g.useState(!1),x=g.useRef(new Set).current,_=(h,w)=>{const C=m===w;return e.jsx(lt,{index:h,disabled:i,enumValuesPath:o,autoFocus:C,shouldUpdateId:c||C,onDialogOpen:()=>n(h),inferredEntry:x.has(a.enumValues[h]?.id)},`${w}`)},k=async()=>{v(!0),l?.().then(h=>{if(!h)return;const w=h.flat(),C=Array.from(new Set(w)),T=a.enumValues,F=xe.extractEnumFromValues(C).filter(I=>!T?.some(B=>B.id===I.id));F.forEach(I=>{x.add(I.id)}),d(o,[...F,...T])}).catch(h=>{console.error(h)}).finally(()=>v(!1))};return e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"ml-3.5 flex flex-row items-center",children:[e.jsx(t.ListIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2 grow",children:"Values"}),p&&e.jsxs(t.Button,{loading:f,variant:"text",size:"small",onClick:k,children:[f?e.jsx(t.CircularProgress,{size:"small"}):e.jsx(t.AutoAwesomeIcon,{}),"Infer values from data"]})]}),e.jsxs(t.Paper,{className:"p-4 m-1",children:[e.jsx(t.FormikArrayContainer,{value:a.enumValues,addLabel:"Add enum value",name:o,buildEntry:_,disabled:i,onInternalIdAdded:b,small:!0,setFieldValue:d,includeAddButton:!0}),e.jsx(ct,{index:s,open:s!==void 0,enumValuesPath:o,onClose:()=>n(void 0)})]})]})}const lt=g.memo(function({index:r,shouldUpdateId:i,enumValuesPath:o,autoFocus:c,onDialogOpen:p,disabled:l,inferredEntry:d}){const{values:m,handleChange:b,errors:s,setFieldValue:n,touched:f}=u.useFormikContext(),v=g.useRef(!u.getIn(m,`${o}[${r}].id`)),y=i||v.current,x=u.getIn(m,`${o}[${r}].id`),_=u.getIn(m,`${o}[${r}].label`),k=u.getIn(s,`${o}[${r}].label`),h=g.useRef(_);return g.useEffect(()=>{(h.current===x||!x)&&y&&n(`${o}[${r}].id`,_),h.current=_},[_]),e.jsxs("div",{className:"flex w-full align-center justify-center",children:[e.jsx(u.FastField,{name:`${o}[${r}].label`,as:t.DebouncedTextField,className:"flex-grow",required:!0,disabled:l,size:"small",validate:dt,autoFocus:c,autoComplete:"off",endAdornment:d&&e.jsx(t.AutoAwesomeIcon,{size:"small"}),error:!!k}),!l&&e.jsx(t.IconButton,{size:"small","aria-label":"edit",className:"m-1",onClick:()=>p(),children:e.jsx(t.SettingsIcon,{size:"small"})})]})},function(r,i){return r.index===i.index&&r.enumValuesPath===i.enumValuesPath&&r.shouldUpdateId===i.shouldUpdateId&&r.inferredEntry===i.inferredEntry&&r.autoFocus===i.autoFocus});function ct({index:a,open:r,onClose:i,enumValuesPath:o}){const{values:c,handleChange:p,errors:l,setFieldValue:d,touched:m}=u.useFormikContext(),b=a!==void 0?u.getIn(l,`${o}[${a}].id`):void 0;return e.jsxs(t.Dialog,{maxWidth:"md","aria-labelledby":"enum-edit-dialog",open:r,onOpenChange:s=>s?void 0:i(),children:[e.jsx(t.DialogContent,{children:a!==void 0&&e.jsxs("div",{children:[e.jsx(u.FastField,{name:`${o}[${a}]id`,as:t.DebouncedTextField,required:!0,validate:pt,label:"ID",size:"small",autoComplete:"off",error:!!b}),e.jsx(Y,{error:!!b,children:b??"Value saved in the data source"})]})}),e.jsx(t.DialogActions,{children:e.jsx(t.Button,{autoFocus:!0,variant:"outlined",onClick:i,color:"primary",children:"Ok"})})]})}function dt(a){let r;return a||(r="You must specify a label"),r}function pt(a){let r;return a||(r="You must specify an ID"),r}function ie({disabled:a}){const{values:r,handleChange:i}=u.useFormikContext(),o="validation.required",c="validation.requiredMessage",p="validation.unique";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-6",children:e.jsx(u.FastField,{type:"checkbox",disabled:a,name:o,label:"Required",tooltip:"You won't be able to save this entity if this value is not set",component:t.SwitchControl})}),e.jsx("div",{className:"col-span-6",children:e.jsx(u.FastField,{type:"checkbox",disabled:a,name:p,label:"Unique",tooltip:"There cannot be multiple entities with the same value",component:t.SwitchControl})}),u.getIn(r,o)&&e.jsx("div",{className:"col-span-12",children:e.jsx(t.DebouncedTextField,{disabled:a,value:u.getIn(r,c),label:"Required message",name:c,size:"small",onChange:i})})]})}function ce({length:a,lowercase:r,matches:i,max:o,min:c,trim:p,uppercase:l,disabled:d,showErrors:m}){const{values:b,handleChange:s,errors:n}=u.useFormikContext(),f="validation.length",v="validation.min",y="validation.max",x="validation.trim",_="validation.matches",k="validation.lowercase",h="validation.uppercase",w=u.getIn(n,_),C=u.getIn(b,_),T=typeof C=="string"?C:t.serializeRegExp(C);return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(ie,{disabled:d}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 col-span-12",children:[r&&e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:k,label:"Lowercase",disabled:d,component:t.SwitchControl})}),l&&e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:h,label:"Uppercase",disabled:d,component:t.SwitchControl})}),p&&e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:x,label:"Trim",disabled:d,component:t.SwitchControl})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 col-span-12",children:[a&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:u.getIn(b,f),label:"Exact length",name:f,type:"number",size:"small",disabled:d,onChange:s})}),c&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:u.getIn(b,v),label:"Min length",name:v,type:"number",size:"small",disabled:d,onChange:s})}),o&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:u.getIn(b,y),label:"Max length",name:y,type:"number",size:"small",disabled:d,onChange:s})})]}),i&&e.jsxs("div",{className:"col-span-12",children:[e.jsx(u.FastField,{name:_,as:t.DebouncedTextField,validate:D=>D&&!t.isValidRegExp(D),label:"Matches regex",size:"small",disabled:d,value:T,error:!!w}),e.jsx(Y,{error:!!w,children:w?"Not a valid regexp":"e.g. /^\\d+$/ for digits only"})]})]})}function Fe({max:a=!0,min:r=!0,disabled:i}){const{values:o,handleChange:c}=u.useFormikContext(),p="validation.min",l="validation.max";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(ie,{disabled:i}),r&&e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(o,p),disabled:i,label:"Min length",name:p,type:"number",size:"small",onChange:c})}),a&&e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(o,l),disabled:i,label:"Max length",name:l,type:"number",size:"small",onChange:c})})]})}function re({children:a}){return e.jsx(t.ExpandablePanel,{initiallyExpanded:!1,asField:!0,className:"p-4",title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.RuleIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"Validation"})]}),children:a})}function Ee({multiselect:a,updateIds:r,disabled:i,showErrors:o,allowDataInference:c,getData:p}){const{values:l,handleChange:d,errors:m,touched:b,setFieldError:s,setFieldValue:n}=u.useFormikContext(),f=t.useSnackbarController(),v=a?"of.enumValues":"enumValues",y=u.getIn(l,"defaultValue"),x=u.getIn(l,v),_=g.useMemo(()=>!x||typeof x=="boolean"?[]:t.resolveEnumValues(x)??[],[x]),k=h=>{if(l&&(n(v,h),!a)){const w=h.filter(C=>!!C?.id).map(C=>C.id);y&&!w.includes(y)&&(n("defaultValue",void 0),f.open({type:"warning",message:"Default value was cleared"}))}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(nt,{enumValues:_,updateIds:r,disabled:i,allowDataInference:c,onError:h=>{s(v,h?"":void 0)},getData:p?()=>p().then(h=>h.map(w=>l.id&&u.getIn(w,l.id)).filter(Boolean)):void 0,onValuesChanged:k})}),e.jsx("div",{className:"col-span-12",children:e.jsxs(re,{children:[!a&&e.jsx(ce,{disabled:i,showErrors:o}),a&&e.jsx(Fe,{disabled:i})]})}),!a&&e.jsx("div",{className:"col-span-12",children:e.jsx(t.Select,{disabled:i,position:"item-aligned",onValueChange:h=>{n("defaultValue",h)},label:"Default value",value:y??"",children:_.filter(h=>!!h?.id).map(h=>e.jsx(t.SelectItem,{value:h.id?.toString(),children:h.label},h.id))})})]})}const be={"image/*":"Images","video/*":"Videos","audio/*":"Audio files","application/*":"Files (pdf, zip, csv, excel...)","text/*":"Text files"};function Ve({multiple:a,existing:r,disabled:i}){const{values:o,setFieldValue:c}=u.useFormikContext(),p=a?"of.storage":"storage",l=`${p}.acceptedFiles`,d=`${p}.fileName`,m=`${p}.storagePath`,b=`${p}.storeUrl`,s=u.getIn(o,d)??"{rand}_{file}",n=u.getIn(o,m)??"/",f=u.getIn(o,l),v=Array.isArray(f)?f:void 0,y=!v||v.length===0,x=h=>{h?h.includes("all")||h.length>=Object.keys(be).length?c(l,void 0):y?c(l,Object.keys(be).filter(w=>!h.includes(w))):c(l,h):c(l,void 0)},_=typeof s=="function",k=typeof n=="function";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(t.ExpandablePanel,{title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.FileUploadIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"File upload config"})]}),children:e.jsxs("div",{className:"grid grid-cols-12 gap-2 p-4",children:[e.jsx("div",{className:"col-span-12",children:e.jsxs(t.MultiSelect,{disabled:i,name:l,value:v??[],onMultiValueChange:x,label:y?void 0:"Allowed file types",renderValues:h=>!h||h.length===0?"All file types allowed":h.map(w=>be[w]).filter(w=>!!w).join(", "),children:[e.jsxs(t.MultiSelectItem,{value:"all",className:"flex items-center gap-2",children:[e.jsx(t.Checkbox,{checked:!v}),"All"]},"all"),Object.entries(be).map(([h,w])=>e.jsxs(t.MultiSelectItem,{value:h,className:"flex items-center gap-2",children:[e.jsx(t.Checkbox,{checked:y||v.indexOf(h)>-1}),e.jsx("div",{className:"flex-grow",children:w}),e.jsx(t.Button,{size:"small",variant:"outlined",onClick:C=>(C.preventDefault(),C.stopPropagation(),c(l,[h])),children:"Only"})]},h))]})}),e.jsx("div",{className:"col-span-12",children:e.jsx(u.Field,{name:d,as:t.DebouncedTextField,label:"File name",size:"small",disabled:_||i,value:_?"-":s})}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(u.Field,{name:m,as:t.DebouncedTextField,label:"Storage path",disabled:k||i,size:"small",value:k?"-":n}),e.jsxs(t.Typography,{variant:"caption",className:"ml-3.5 mt-1 mb-2",children:[e.jsx("p",{children:"You can use the following placeholders in the file name and storage path values:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"{file} - Full name of the uploaded file"}),e.jsx("li",{children:"{file.name} - Name of the uploaded file without extension"}),e.jsx("li",{children:"{file.ext} - Extension of the uploaded file"}),e.jsx("li",{children:"{entityId} - ID of the entity"}),e.jsx("li",{children:"{propertyKey} - ID of this field"}),e.jsx("li",{children:"{path} - Path of this entity"}),e.jsx("li",{children:"{rand} - Random value used to avoid name collisions"})]})]}),e.jsx(u.Field,{type:"checkbox",name:b,label:"Save URL instead of storage path",disabled:r||i,component:t.SwitchControl}),e.jsx("br",{}),e.jsx(t.Typography,{variant:"caption",className:"ml-3.5 mt-1 mb-2",children:"Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation."})]})]})})}),e.jsx("div",{className:"col-span-12",children:e.jsxs(re,{children:[!a&&e.jsx("div",{className:"grid grid-cols-12 gap-2",children:e.jsx(ie,{disabled:i})}),a&&e.jsx("div",{className:"col-span-12",children:e.jsx(Fe,{disabled:i})})]})})]})}function Be(a){return typeof a=="function"}function de(a){if(t.isPropertyBuilder(a)||Be(a))return!1;{const r=a;return r.dataType==="array"&&typeof r.of=="function"||r.dataType==="array"&&Array.isArray(r.of)?!1:r.editable!==void 0?r.editable:!0}}function je(a){return Object.entries(a).filter(([r,i])=>de(i)).map(([r,i])=>{const o=i;if(de(o))return o.dataType==="map"&&o.properties?{[r]:{...o,properties:je(o.properties)}}:{[r]:o}}).filter(r=>!!r).reduce((r,i)=>({...r,...i}),{})}function Me({property:a,onClick:r,hasError:i,includeName:o,includeEditButton:c,selected:p}){const l=t.getFieldConfig(a),d=!de(a),m=i?"border-red-500":p?"border-blue-500":"border-transparent";return e.jsx(t.ErrorBoundary,{children:e.jsxs("div",{onClick:r,className:"flex flex-row w-full cursor-pointer",children:[e.jsx("div",{className:"m-4",children:e.jsx(t.FieldConfigBadge,{widget:l})}),e.jsxs(t.Paper,{className:t.cn("pl-2 w-full flex flex-row gap-4 items-center",t.cardMixin,r?t.cardClickableMixin:"",p?t.cardSelectedMixin:"","flex-grow p-4 border transition-colors duration-200",m),children:[e.jsxs("div",{className:"w-full flex flex-col",children:[o&&e.jsx(t.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body1",component:"span",className:"flex-grow pr-2",children:a.name?a.name:" "})}),e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx(t.ErrorBoundary,{children:e.jsx(t.Typography,{className:"flex-grow pr-2",variant:o?"body2":"subtitle1",component:"span",color:"secondary",children:l?.name})}),e.jsx(t.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:a.dataType})}),d&&e.jsx("div",{className:"text-xs h-3 ml-0.5",children:e.jsx(t.RemoveCircleIcon,{color:"disabled"})})]})]}),c&&e.jsx(t.Typography,{variant:"button",children:"EDIT"})]})]})})}function mt({name:a,selected:r,onClick:i}){return e.jsxs("div",{onClick:i,className:"flex flex-row w-full cursor-pointer",children:[e.jsx("div",{className:"bg-gray-500 h-8 mt-0.5 p-0.5 rounded-full shadow-md text-white",children:e.jsx(t.FunctionsIcon,{color:"inherit",size:"medium"})}),e.jsx("div",{className:"pl-12 w-full flex flex-row",children:e.jsx(t.Paper,{className:t.cn("flex-grow p-2 border border-blue-500",r?"bg-blue-50 dark:bg-blue-800":"bg-transparent"),children:e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:a}),e.jsxs("div",{className:"flex flex-row text-xs",children:[e.jsx(t.Typography,{className:"flex-grow pr-2",variant:"body2",component:"span",color:"secondary",children:"This field can only be edited in code"}),e.jsx(t.RemoveCircleIcon,{color:"disabled"})]})]})})})]})}function fe({namespace:a,selectedPropertyKey:r,onPropertyClick:i,properties:o,propertiesOrder:c,errors:p,onPropertyMove:l,onPropertyRemove:d,className:m,inferredPropertyKeys:b}){const s=c??Object.keys(o),n=g.useCallback(f=>{if(!f.destination)return;const v=f.source.index,y=f.destination.index,x=Array.from(s),[_]=x.splice(v,1);x.splice(y,0,_),l&&l(x,a)},[a,l,s]);return e.jsx(e.Fragment,{children:e.jsx(Ce.DragDropContext,{onDragEnd:n,children:e.jsx(Ce.Droppable,{droppableId:`droppable_${a}`,children:(f,v)=>e.jsxs("div",{...f.droppableProps,ref:f.innerRef,className:m,children:[s&&s.filter(y=>!!o[y]).map((y,x)=>e.jsx(Ce.Draggable,{draggableId:`array_field_${a}_${y}}`,index:x,children:(_,k)=>{const h=o[y];return e.jsx(t.ErrorBoundary,{children:e.jsx(ut,{propertyKey:y,propertyOrBuilder:h,provided:_,errors:p,namespace:a,inferredPropertyKeys:b,onPropertyMove:l,onPropertyRemove:d,onPropertyClick:k.isDragging?void 0:i,selectedPropertyKey:r})})}},`array_field_${a}_${y}}`)),f.placeholder]})})})})}function ut({propertyKey:a,namespace:r,propertyOrBuilder:i,provided:o,selectedPropertyKey:c,errors:p,onPropertyClick:l,onPropertyMove:d,onPropertyRemove:m,inferredPropertyKeys:b}){const s=b?.includes(r?`${r}.${a}`:a),n=H(a,r);let f;if(typeof i=="object"){const x=i;x.dataType==="map"&&x.properties&&(f=e.jsx(fe,{selectedPropertyKey:c,namespace:n,properties:x.properties,propertiesOrder:x.propertiesOrder,errors:p,onPropertyClick:l,onPropertyMove:d,onPropertyRemove:m}))}const v=n?u.getIn(p,J(n)):!1,y=c===n;return de(i),e.jsxs("div",{ref:o.innerRef,...o.draggableProps,...o.dragHandleProps,className:"relative -ml-8",children:[f&&e.jsx("div",{className:"absolute border-l "+t.defaultBorderMixin,style:{left:"32px",top:"64px",bottom:"16px"}}),Be(i)?e.jsx(mt,{name:a,onClick:l?()=>l(a,r):void 0,selected:y}):e.jsx(Me,{property:i,onClick:l?()=>l(a,r):void 0,includeName:!0,selected:y,hasError:v}),e.jsxs("div",{className:"absolute top-2 right-2 flex flex-row ",children:[s&&e.jsx(t.Tooltip,{title:"Inferred property",children:e.jsx(t.AutoAwesomeIcon,{size:"small",className:"p-2"})}),m&&e.jsx(t.Tooltip,{title:"Remove",children:e.jsx(t.IconButton,{size:"small",color:"inherit",onClick:()=>m(a,r),children:e.jsx(t.RemoveIcon,{size:"small"})})}),d&&e.jsx(t.Tooltip,{title:"Move",children:e.jsx(t.IconButton,{component:"span",size:"small",children:e.jsx(t.DragHandleIcon,{size:"small"})})})]}),f&&e.jsx("div",{className:"ml-16",children:f})]})}function ht({disabled:a,getData:r,allowDataInference:i}){const{values:o,setFieldValue:c}=u.useFormikContext(),[p,l]=g.useState(!1),[d,m]=g.useState(),[b,s]=g.useState(),n=o.propertiesOrder??Object.keys(o.properties??{}),f=g.useCallback(({id:w,property:C})=>{if(!w)throw Error();c("properties",{...o.properties??{},[w]:C},!1),c("propertiesOrder",[...n,w],!1),l(!1)},[o.properties,n]),v=g.useCallback((w,C)=>{const T=w?H(w,C):void 0;if(!T)throw Error("collection editor miss config");const D=J(T),F=ae(C),I=u.getIn(o,F)??Object.keys(u.getIn(o,ot(C)));c(D,void 0,!1),c(F,I.filter(B=>B!==w),!1),l(!1),m(void 0),s(void 0)},[c,o]),y=d?H(d,b):void 0,x=y?u.getIn(o.properties,y.replaceAll(".",".properties.")):void 0,_=e.jsxs(t.Button,{color:"primary",variant:"outlined",onClick:()=>l(!0),startIcon:e.jsx(t.AddIcon,{}),children:["Add property to ",o.name??"this group"]}),k=!n||n.length<1,h=g.useCallback((w,C)=>{c(ae(C),w,!1)},[]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"flex justify-between items-end my-4",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Properties in this group"}),_]}),e.jsxs(t.Paper,{className:"p-2 pl-8",children:[e.jsx(fe,{properties:o.properties??{},propertiesOrder:n,errors:{},onPropertyClick:(w,C)=>{m(w),s(C),l(!0)},onPropertyMove:h}),k&&e.jsx("div",{className:"h-full flex items-center justify-center p-2",children:"Add the first property to this group"})]})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.BooleanSwitchWithLabel,{position:"start",size:"small",label:"Spread children as columns",onValueChange:w=>c("spreadChildren",w),value:o.spreadChildren??!1}),e.jsx(Y,{children:"Set this flag to true if you want to display the children of this group as individual columns."})]}),e.jsx(pe,{inArray:!1,forceShowErrors:!1,open:p,allowDataInference:i,onCancel:()=>{l(!1),m(void 0),s(void 0)},onOkClicked:()=>{l(!1),m(void 0),s(void 0)},getData:r,onDelete:v,propertyKey:d,propertyNamespace:b,property:x,existing:!!d,autoUpdateId:!d,autoOpenTypeSelect:!d,onPropertyChanged:f,existingPropertyKeys:d?void 0:n})]})}function gt({showErrors:a,existing:r,disabled:i,getData:o,allowDataInference:c}){const{values:p,handleChange:l,errors:d,setFieldValue:m,touched:b}=u.useFormikContext(),[s,n]=g.useState(!1),f=u.getIn(p,"of"),v=u.getIn(b,"of")&&u.getIn(d,"of"),y=g.useCallback(({id:_,property:k,namespace:h})=>{m("of",k)},[]),x=f&&t.getFieldConfig(f);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Repeat component"}),e.jsx(u.Field,{name:"of",value:f,validate:_=>_?.dataType?void 0:"You need to specify a repeat field",children:()=>e.jsxs(t.Paper,{className:"p-2 mt-4",children:[f&&e.jsx(Me,{property:f,onClick:i?void 0:()=>n(!0),includeName:!1,includeEditButton:!0,selected:!1,hasError:!1}),!i&&!f&&e.jsxs(t.Button,{variant:"text",size:"large",color:v?"error":"primary",onClick:()=>n(!0),children:["Edit ",`${x?x.name:"repeat component"}`]}),e.jsx(pe,{inArray:!0,open:s,existing:r,getData:o,autoUpdateId:!r,autoOpenTypeSelect:!r,onOkClicked:()=>n(!1),allowDataInference:c,property:f,includeIdAndName:!1,onPropertyChanged:y,forceShowErrors:a})]})})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(re,{children:e.jsx(Fe,{disabled:i})})})]})}const bt=g.forwardRef(function({showErrors:r,disabledId:i,existingPropertyKeys:o,disabled:c,isNewProperty:p},l){const{errors:d}=u.useFormikContext(),m="name",b=r&&u.getIn(d,m),s="id",n=r&&u.getIn(d,s),f="description",v=r&&u.getIn(d,f);return e.jsxs("div",{className:"flex flex-col gap-2 col-span-12",children:[e.jsxs("div",{children:[e.jsx(u.Field,{inputRef:l,name:m,as:t.DebouncedTextField,invisible:!p,style:{fontSize:20},validate:vt,placeholder:"Field name",required:!0,disabled:c,error:!!b}),e.jsx(Y,{error:!!b,children:b})]}),e.jsxs("div",{children:[e.jsx(u.Field,{name:s,as:t.TextField,label:"ID",validate:y=>yt(y,o),disabled:i||c,required:!0,size:"small",error:!!n}),e.jsx(Y,{error:!!n,children:n})]}),e.jsxs("div",{children:[e.jsx(u.Field,{name:f,as:t.DebouncedTextField,label:"Description",disabled:c,error:!!v}),e.jsx(Y,{error:!!v,children:v})]})]})}),ft=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function yt(a,r){let i;return a||(i="You must specify an id for the field"),a&&!a.match(ft)&&(i="The id can only contain letters, numbers and underscores (_), and not start with a number"),a&&r&&r.includes(a)&&(i="There is another field with this ID already"),i}function vt(a){let r;return a||(r="You must specify a title for the field"),r}function wt({widgetId:a,disabled:r,showErrors:i}){const{values:o,setFieldValue:c}=u.useFormikContext();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsxs(re,{children:[a==="text_field"&&e.jsx(ce,{disabled:r,length:!0,lowercase:!0,matches:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:i}),a==="multiline"&&e.jsx(ce,{disabled:r,length:!0,lowercase:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:i}),a==="markdown"&&e.jsx(ce,{disabled:r,length:!0,lowercase:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:i}),a==="url"&&e.jsx(ce,{disabled:r,max:!0,min:!0,trim:!0,showErrors:i}),a==="email"&&e.jsx(ce,{disabled:r,max:!0,min:!0,trim:!0,showErrors:i})]})}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.TextField,{name:"defaultValue",disabled:r,onChange:p=>{c("defaultValue",p.target.value===""?void 0:p.target.value)},label:"Default value",value:u.getIn(o,"defaultValue")??""})})]})}function _t({disabled:a}){const{values:r}=u.useFormikContext(),i=u.getIn(r,"defaultValue");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(re,{children:e.jsx(ie,{disabled:a})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(u.FastField,{type:"checkbox",name:"defaultValue",label:i==null?"Default value not set":"Default value is "+i.toString(),disabled:a,allowIndeterminate:!0,component:t.SwitchControl})})]})}function kt({disabled:a,getData:r,allowDataInference:i}){const{values:o,setFieldValue:c}=u.useFormikContext(),[p,l]=g.useState(!1),[d,m]=g.useState(),[b,s]=g.useState(),n=g.useCallback(({id:k,property:h})=>{if(!k)throw Error();c("oneOf.properties",{...o.oneOf?.properties??{},[k]:h},!1),c("oneOf.propertiesOrder",[...o.oneOf?.propertiesOrder??Object.keys(o.oneOf?.properties??{}),k],!1),l(!1)},[o.oneOf?.properties,o.oneOf?.propertiesOrder]),f=d?H(d,b):void 0,v=f?u.getIn(o.oneOf?.properties,f.replaceAll(".",".properties.")):void 0,y=g.useCallback((k,h)=>{const w=k?H(k,h):void 0;if(!w)throw Error("collection editor miss config");c(`oneOf.${J(w)}`,void 0,!1);const C=`oneOf.${ae(h)}`,T=u.getIn(o,C);c(C,T.filter(D=>D!==k),!1),l(!1),m(void 0),s(void 0)},[c,o]),x=e.jsxs(t.Button,{autoFocus:!0,color:"primary",onClick:()=>l(!0),startIcon:e.jsx(t.AddIcon,{}),children:["Add property to ",o.name??"this block"]}),_=g.useCallback((k,h)=>{c(`oneOf.${ae(h)}`,k,!1)},[]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"flex justify-between items-end mt-8 mb-4",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Properties in this block"}),x]}),e.jsxs(t.Paper,{className:"p-2 pl-8",children:[e.jsx(fe,{properties:o.oneOf?.properties??{},propertiesOrder:o.oneOf?.propertiesOrder,errors:{},onPropertyClick:a?void 0:(k,h)=>{m(k),s(h),l(!0)},onPropertyMove:a?void 0:_}),!a&&!o.oneOf?.propertiesOrder?.length&&e.jsx("div",{className:"h-full flex items-center justify-center p-4",children:"Add the first property to this block"})]})]}),!a&&e.jsx(pe,{inArray:!1,forceShowErrors:!1,open:p,getData:r,allowDataInference:i,onCancel:()=>{l(!1),m(void 0),s(void 0)},onOkClicked:()=>{l(!1),m(void 0),s(void 0)},onDelete:y,propertyKey:d,propertyNamespace:b,property:v,existing:!!d,autoUpdateId:!d,autoOpenTypeSelect:!d,onPropertyChanged:n,existingPropertyKeys:d?void 0:o.oneOf?.propertiesOrder})]})}function xt({disabled:a}){const{values:r,handleChange:i}=u.useFormikContext(),o="validation.min",c="validation.max",p="validation.lessThan",l="validation.moreThan",d="validation.positive",m="validation.negative",b="validation.integer";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(ie,{disabled:a}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(r,o),label:"Min value",name:o,type:"number",size:"small",disabled:a,onChange:i})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(r,c),label:"Max value",name:c,type:"number",size:"small",disabled:a,onChange:i})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(r,p),label:"Less than",name:p,type:"number",size:"small",disabled:a,onChange:i})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:u.getIn(r,l),label:"More than",name:l,type:"number",size:"small",disabled:a,onChange:i})}),e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:d,label:"Positive value",disabled:a,component:t.SwitchControl})}),e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:m,label:"Negative value",disabled:a,component:t.SwitchControl})}),e.jsx("div",{className:"col-span-4",children:e.jsx(u.FastField,{type:"checkbox",name:b,label:"Integer value",disabled:a,component:t.SwitchControl})})]})}function Ct({disabled:a}){const{values:r,setFieldValue:i}=u.useFormikContext();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(re,{children:e.jsx(xt,{disabled:a})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.TextField,{name:"defaultValue",disabled:a,type:"number",onChange:o=>{i("defaultValue",o.target.value===""?void 0:parseFloat(o.target.value))},label:"Default value",value:u.getIn(r,"defaultValue")??""})})]})}function Ue({existing:a,multiple:r,disabled:i,showErrors:o}){const{values:c,handleChange:p,errors:l,touched:d,setFieldError:m,setFieldValue:b}=u.useFormikContext();if(!t.useNavigationContext())return e.jsx("div",{className:"col-span-12",children:e.jsx(t.CircularProgress,{})});const n=r?"of.path":"path",f=u.getIn(c,n),v=o&&u.getIn(l,n);return console.log("pathError",l,v),e.jsx(e.Fragment,{children:e.jsx("div",{className:"col-span-12",children:e.jsx(u.Field,{required:!0,name:n,pathPath:n,type:"select",validate:Tt,disabled:a||i,value:f,error:v,handleChange:p,component:Pt})})})}function Tt(a){let r;return a||(r="You must specify a target collection for the field"),r}function Pt({disabled:a,pathPath:r,value:i,handleChange:o,error:c,...p}){console.log("error",c);const l=t.useNavigationContext();if(!l)return e.jsx("div",{className:"col-span-12",children:e.jsx(t.CircularProgress,{})});const d=l?.collections??[],m=Array.from(new Set(Object.values(d).map(s=>s.group).filter(Boolean)).values()),b=d.filter(s=>!s.group);return e.jsxs(e.Fragment,{children:[e.jsxs(t.Select,{error:!!c,disabled:a,value:i??"",position:"item-aligned",name:r,onChange:o,label:"Target collection",renderValue:s=>{const n=d.find(v=>v.alias===s||v.path===s);if(!n)return null;const f=t.getIconForView(n);return e.jsxs("div",{className:"flex flex-row",children:[f,e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:n?.name.toUpperCase()})]})},...p,children:[m.flatMap(s=>e.jsx(t.SelectGroup,{label:s||"Views",children:d.filter(n=>n.group===s).map(n=>{const f=t.getIconForView(n);return e.jsx(t.SelectItem,{value:n.alias??n.path,children:e.jsxs("div",{className:"flex flex-row",children:[f,e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:n?.name.toUpperCase()})]})},`${n.alias??n.path}-${s}`)})},`group_${s}`)),b&&e.jsx(t.SelectGroup,{label:"Views",children:b.map(s=>{const n=t.getIconForView(s);return e.jsx(t.SelectItem,{value:s.alias??s.path,children:e.jsxs("div",{className:"flex flex-row",children:[n,e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:s?.name.toUpperCase()})]})},s.alias??s.path)})})]}),e.jsx(Y,{children:"You can only edit the reference collection upon field creation."})]})}function Ft({disabled:a}){const{values:r,errors:i,touched:o,setFieldValue:c}=u.useFormikContext(),p="mode",l=u.getIn(r,p),d=u.getIn(o,p)&&u.getIn(i,p),m="autoValue",b=u.getIn(r,m),s=u.getIn(o,m)&&u.getIn(i,m);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col col-span-12",children:[e.jsxs(t.Select,{name:p,value:l??"date",error:!!d,onValueChange:n=>c(p,n),label:"Mode",renderValue:n=>{switch(n){case"date_time":return"Date/Time";case"date":return"Date";default:return""}},disabled:a,children:[e.jsx(t.SelectItem,{value:"date_time",children:" Date/Time "}),e.jsx(t.SelectItem,{value:"date",children:" Date "})]}),e.jsx(Y,{error:!!d,children:d}),e.jsxs(t.Select,{name:m,disabled:a,value:b??"",onValueChange:n=>c(m,n),renderValue:n=>{switch(n){case"on_create":return"On create";case"on_update":return"On any update";default:return"None"}},error:!!s,label:"Automatic value",children:[e.jsx(t.SelectItem,{value:"",children:" None "}),e.jsx(t.SelectItem,{value:"on_create",children:" On create "}),e.jsx(t.SelectItem,{value:"on_update",children:" On any update "})]}),e.jsx(Y,{error:!!s,children:s??"Update this field automatically when creating or updating the entity"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(re,{children:e.jsx(ie,{disabled:a})})})]})}function St({disabled:a}){u.useFormikContext();const r="hideFromCollection",i="readOnly";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx("div",{className:"col-span-12",children:e.jsx(u.FastField,{type:"checkbox",name:r,label:"Hide from collection",disabled:a,tooltip:"Hide this field from the collection view. It will still be visible in the form view",component:t.SwitchControl})}),e.jsx("div",{className:"col-span-12",children:e.jsx(u.FastField,{type:"checkbox",name:i,label:"Read only",disabled:a,tooltip:"Is this a read only field. Display only as a preview",component:t.SwitchControl})})]})}function Ot({disabled:a}){return e.jsx(e.Fragment,{children:e.jsx("div",{className:"col-span-12",children:e.jsx(re,{children:e.jsx(ie,{disabled:a})})})})}function $e(a,r){let i;return r==="text_field"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:void 0})):r==="multiline"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,multiline:!0,storage:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:void 0})):r==="markdown"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:void 0,multiline:void 0,markdown:!0,email:void 0,url:void 0})):r==="url"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:!0,enumValues:void 0})):r==="email"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:!0,url:void 0,enumValues:void 0})):r==="select"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:a.enumValues??[]})):r==="multi_select"?i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0,of:{dataType:"string",enumValues:a.of?.enumValues??[]}})):r==="number_input"?i=t.mergeDeep(a,t.buildProperty({dataType:"number",editable:!0,enumValues:void 0})):r==="number_select"?i=t.mergeDeep(a,t.buildProperty({dataType:"number",editable:!0,enumValues:a.enumValues??[]})):r==="multi_number_select"?i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0,of:{dataType:"number",enumValues:a.of?.enumValues??[]}})):r==="file_upload"?i=t.mergeDeep(a,t.buildProperty({dataType:"string",editable:!0,storage:{storagePath:"/"}})):r==="multi_file_upload"?i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0,of:{dataType:"string",storage:a.of?.storage??{storagePath:"/"}}})):r==="group"?i=t.mergeDeep(a,t.buildProperty({dataType:"map",editable:!0,keyValue:!1,properties:a.properties??{}})):r==="key_value"?i=t.mergeDeep(a,t.buildProperty({dataType:"map",editable:!0,keyValue:!0,properties:void 0})):r==="reference"?i=t.mergeDeep(a,t.buildProperty({dataType:"reference",editable:!0})):r==="multi_references"?i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0,of:{dataType:"reference"}})):r==="switch"?i=t.mergeDeep(a,t.buildProperty({dataType:"boolean",editable:!0})):r==="date_time"?i=t.mergeDeep(a,t.buildProperty({dataType:"date",editable:!0,mode:"date_time"})):r==="repeat"?i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0})):r==="block"&&(i=t.mergeDeep(a,t.buildProperty({dataType:"array",editable:!0,oneOf:{properties:{}}}))),i}function Le({value:a,optionDisabled:r,widget:i,existing:o}){return e.jsx(t.SelectItem,{value:a,disabled:r,className:"flex flex-row items-center",children:e.jsxs("div",{className:t.cn("flex flex-row items-center text-base min-h-[52px]",r?"w-full":""),children:[e.jsx("div",{className:"mr-8",children:e.jsx(t.FieldConfigBadge,{widget:i})}),e.jsxs("div",{children:[e.jsx("div",{children:i.name}),e.jsx(t.Typography,{variant:"caption",color:"disabled",className:"max-w-sm",children:o&&r?"You can only switch to widgets that use the same data type":i.description})]})]})})}const Nt=["text_field","multiline","markdown","url","email","select","multi_select","number_input","number_select","multi_number_select","file_upload","multi_file_upload","group","key_value","reference","multi_references","switch","date_time","repeat","block"],Se=Object.entries(t.DEFAULT_FIELD_CONFIGS).filter(([a])=>Nt.includes(a)),Ke=g.memo(function({includeIdAndName:r=!0,autoOpenTypeSelect:i,existing:o,autoUpdateId:c,inArray:p,propertyKey:l,propertyNamespace:d,property:m,onPropertyChanged:b,onPropertyChangedImmediate:s=!0,onDelete:n,onError:f,initialErrors:v,forceShowErrors:y,existingPropertyKeys:x,allowDataInference:_,getHelpers:k,getData:h}){const w={id:"",name:""},C=(m&&!de(m))??!1,T=g.useRef(m?{id:l,previousId:l,property:m}:void 0),D=({id:F,property:I})=>{const B={id:F,previousId:T.current?.id,property:I,namespace:d};T.current=B,b?.(B)};return e.jsx(u.Formik,{initialErrors:v,initialValues:m?{id:l,...m}:w,onSubmit:(F,I)=>{console.log("Submitting property",F);const{id:B,...P}=F;D({id:B,property:P}),o||I.resetForm({values:w})},children:F=>(g.useEffect(()=>{k?.(F)},[F]),e.jsx(It,{onPropertyChanged:s?D:void 0,onDelete:n,includeIdAndTitle:r,propertyNamespace:d,onError:f,showErrors:y||F.submitCount>0,existing:o,autoUpdateId:c,inArray:p,autoOpenTypeSelect:i,existingPropertyKeys:x,disabled:C,getData:h,allowDataInference:_,...F}))},`property_view_${l}`)},(a,r)=>a.getData===r.getData&&a.includeIdAndName===r.includeIdAndName&&a.autoOpenTypeSelect===r.autoOpenTypeSelect&&a.autoUpdateId===r.autoUpdateId&&a.existing===r.existing);function pe({open:a,onCancel:r,onOkClicked:i,onPropertyChanged:o,getData:c,...p}){const l=g.useRef(),d=m=>{l.current=m};return e.jsx(t.Dialog,{open:a??!1,maxWidth:"xl",fullWidth:!0,children:e.jsxs(u.Form,{noValidate:!0,style:{height:"100%"},children:[e.jsx(t.DialogContent,{children:e.jsx(Ke,{...p,onPropertyChanged:m=>{o?.(m),i?.()},onPropertyChangedImmediate:!1,getHelpers:d,getData:c})}),e.jsxs(t.DialogActions,{children:[r&&e.jsx(t.Button,{variant:"text",onClick:()=>{r(),l.current?.resetForm()},children:"Cancel"}),e.jsx(t.Button,{variant:"outlined",color:"primary",onClick:()=>l.current?.submitForm(),children:"Ok"})]})]})})}function It({values:a,errors:r,touched:i,setValues:o,setFieldValue:c,existing:p,autoUpdateId:l=!1,autoOpenTypeSelect:d,includeIdAndTitle:m,onPropertyChanged:b,onDelete:s,propertyNamespace:n,onError:f,showErrors:v,disabled:y,inArray:x,existingPropertyKeys:_,getData:k,allowDataInference:h}){const[w,C]=g.useState(!1),[T,D]=g.useState(a?.dataType?t.getFieldId(a):void 0),F=x?Se.filter(([$,W])=>W.dataType!=="array"):Se,I=g.useDeferredValue(a),B=g.useRef(null),P=g.useRef(a),M="id",S=v&&u.getIn(r,"selectedWidget");g.useEffect(()=>{!u.getIn(i,M)&&l&&a?.name&&c(M,t.toSnakeCase(a.name))},[l,i,a?.name]),g.useEffect(()=>{if(b&&(!m||I.id)){const{id:$,...W}=I;ge(I,P.current)||(b({id:$,property:W,namespace:n}),P.current=I)}},[I,m,b,n]),g.useEffect(()=>{a?.id&&f&&Object.keys(r).length>0&&f(a?.id,n,r)},[r,f,n,a?.id]);const U=$=>{D($),o($e(a,$)),setTimeout(()=>{B.current?.focus()},0)};let A;return T==="text_field"||T==="multiline"||T==="markdown"||T==="url"||T==="email"?A=e.jsx(wt,{widgetId:T,disabled:y,showErrors:v}):T==="select"||T==="number_select"?A=e.jsx(Ee,{multiselect:!1,allowDataInference:h,updateIds:!p,disabled:y,getData:k,showErrors:v}):T==="multi_select"||T==="multi_number_select"?A=e.jsx(Ee,{multiselect:!0,updateIds:!p,disabled:y,allowDataInference:h,getData:k,showErrors:v}):T==="file_upload"?A=e.jsx(Ve,{existing:p,multiple:!1,disabled:y}):T==="multi_file_upload"?A=e.jsx(Ve,{existing:p,multiple:!0,disabled:y}):T==="switch"?A=e.jsx(_t,{disabled:y}):T==="number_input"?A=e.jsx(Ct,{disabled:y}):T==="group"?A=e.jsx(ht,{disabled:y,getData:k,allowDataInference:h}):T==="block"?A=e.jsx(kt,{disabled:y,getData:k,allowDataInference:h}):T==="reference"?A=e.jsx(Ue,{showErrors:v,existing:p,multiple:!1,disabled:y}):T==="date_time"?A=e.jsx(Ft,{disabled:y}):T==="multi_references"?A=e.jsx(Ue,{showErrors:v,existing:p,multiple:!0,disabled:y}):T==="repeat"?A=e.jsx(gt,{showErrors:v,existing:p,getData:k,allowDataInference:h,disabled:y}):T==="key_value"?A=e.jsx(Ot,{disabled:y}):A=null,e.jsxs(e.Fragment,{children:[y&&e.jsxs(t.InfoLabel,{children:[e.jsx(t.Typography,{children:"This property can't be edited"}),e.jsx(t.Typography,{variant:"caption",children:"You may not have permission to edit it or it is defined in code only"})]}),e.jsxs("div",{className:"flex mt-2 justify-between",children:[e.jsx(t.Select,{className:"w-full",error:!!S,value:T??"",placeholder:"Select a property widget",open:d,position:"item-aligned",renderValue:$=>{if(!$)return e.jsx("em",{children:"Select a property widget"});const W=$,K=t.DEFAULT_FIELD_CONFIGS[W],oe=p&&K.dataType!==a?.dataType;return e.jsxs("div",{onClick:ne=>{oe&&(ne.stopPropagation(),ne.preventDefault())},className:t.cn("flex items-center",oe?"w-full pointer-events-none opacity-50":""),children:[e.jsx("div",{className:"mr-8",children:e.jsx(t.FieldConfigBadge,{widget:K})}),e.jsxs("div",{className:"flex flex-col items-start text-base text-left",children:[e.jsx("div",{children:K.name}),e.jsx(t.Typography,{variant:"caption",color:"disabled",children:p&&K.dataType!==a?.dataType?"You can only switch to widgets that use the same data type":K.description})]})]})},onValueChange:$=>{U($)},children:F.map(([$,W])=>{const K=p&&W.dataType!==a?.dataType;return e.jsx(Le,{value:$,optionDisabled:K,widget:W,existing:p},$)})}),S&&e.jsx(t.Typography,{variant:"caption",color:"error",children:"Required"}),s&&a?.id&&e.jsx(t.IconButton,{variant:"ghost",className:"m-4",disabled:y,onClick:()=>C(!0),children:e.jsx(t.DeleteIcon,{})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-y-12 mt-8 mb-8",children:[m&&e.jsx(bt,{showErrors:v,disabledId:p,isNewProperty:!p,existingPropertyKeys:_,disabled:y,ref:B}),A,e.jsx("div",{className:"col-span-12",children:e.jsx(St,{disabled:y})})]}),s&&e.jsx(t.DeleteConfirmationDialog,{open:w,onAccept:()=>s(a?.id,n),onCancel:()=>C(!1),title:e.jsx("div",{children:"Delete this property?"}),body:e.jsxs("div",{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only modify the collection."]})})]})}function qt({showErrors:a,isNewCollection:r,propertyErrorsRef:i,onPropertyError:o,setDirty:c,reservedGroups:p,extraIcon:l,getUser:d,getData:m,doCollectionInference:b}){const{values:s,setFieldValue:n,setFieldError:f,setFieldTouched:v,errors:y,dirty:x}=u.useFormikContext(),_=t.useSnackbarController(),k=t.useLargeLayout("lg"),h=!k,[w,C]=g.useState(),[T,D]=g.useState(),[F,I]=g.useState(),B=T?H(T,F):void 0,P=B?u.getIn(s.properties,B.replaceAll(".",".properties.")):void 0,[M,S]=g.useState(!1),[U,A]=g.useState(!1),[$,W]=g.useState([]),K=g.useRef(s.propertiesOrder?{"":s.propertiesOrder}:{});g.useEffect(()=>{c&&c(x)},[x]);const oe=b?()=>{b&&(S(!0),b(s).then(N=>{if(!N){_.open({type:"error",message:"Could not infer properties from data"});return}const q=Object.keys(N.properties).filter(Q=>!s.properties[Q]);if(q.length===0){_.open({type:"info",message:"No new properties found"});return}const V={...q.reduce((Q,R)=>(Q[R]=N.properties[R],Q),{}),...s.properties},Z=[...q,...s.propertiesOrder??[]];n("properties",V,!1),se(Z),W(q)}).finally(()=>{S(!1)}))}:void 0,ne=N=>N?K.current[N]??u.getIn(s,ae(N)):K.current[""],se=(N,q)=>{const V=ae(q);n(V,N,!1),K.current[q??""]=N},me=(N,q)=>{const V=N?H(N,q):void 0;if(!V)throw Error("collection editor miss config");n(J(V),void 0,!1);const Q=ne(q).filter(R=>R!==N);se(Q,q),A(!1),C(void 0),D(void 0),I(void 0)},ue=(N,q)=>{n(ae(q),N,!1)},he=({id:N,property:q})=>{if(console.log("onPropertyCreated",{id:N,property:q}),!N)throw Error("Need to include an ID when creating a new property");n("properties",{...s.properties??{},[N]:q},!1);const V=[...s.propertiesOrder??Object.keys(s.properties),N];console.log("onPropertyCreated",{id:N,property:q,newPropertiesOrder:V}),se(V),A(!1),k&&(C(V.indexOf(N)),D(N)),I(void 0)},G=({id:N,property:q,previousId:V,namespace:Z})=>{const Q=N?H(N,Z):void 0,R=Q?J(Q):void 0;if(V&&V!==N){const qe=H(V,Z),L=J(qe),ee=ne(Z).map(ke=>ke===V?N:ke).filter(ke=>ke!==void 0);se(ee,Z),N&&(C(ee.indexOf(N)),D(N)),n(L,void 0,!1),v(L,!1,!1)}R&&(n(R,q,!1),v(R,!0,!1))},le=(N,q,V)=>{const Z=N?H(N,q):void 0;if(console.warn("onPropertyErrorInternal",{id:N,namespace:q,error:V,propertyPath:Z}),Z){const Q=V&&Object.keys(V).length>0;o(N,q,Q?V:void 0),f(J(Z),Q?"Property error":void 0)}},Ie=()=>{C(void 0),D(void 0)},we=T&&i?.current?.properties?i.current.properties[T]:void 0,O=s?.propertiesOrder===void 0||s.propertiesOrder.length===0,E=s.propertiesOrder?s.propertiesOrder.filter(N=>s.properties[N]):Object.keys(s.properties),z=g.useMemo(()=>d(s.ownerId),[d,s.ownerId]),_e=e.jsxs("div",{className:"grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900",children:[e.jsxs("div",{className:t.cn("p-4 md:p-8 pb-20 md:pb-20","col-span-12 lg:col-span-5 h-full overflow-auto",!h&&"border-r "+t.defaultBorderMixin),children:[e.jsxs("div",{className:"flex my-2",children:[e.jsxs("div",{className:"flex-grow mb-4",children:[e.jsx(u.Field,{name:"name",as:t.DebouncedTextField,invisible:!0,className:"-ml-1",inputClassName:"text-2xl font-headers",placeholder:"Collection name",size:"small",required:!0,error:!!y.name}),z&&e.jsxs(t.Typography,{variant:"body2",className:"ml-2",color:"secondary",children:["Created by ",z.displayName]})]}),l&&e.jsx("div",{className:"ml-4",children:l}),e.jsxs("div",{className:"ml-1 mt-2 flex flex-row gap-2",children:[oe&&e.jsx(t.Tooltip,{title:"Add new properties based on data",children:e.jsx(t.Button,{variant:"text",disabled:M,onClick:oe,children:M?e.jsx(t.CircularProgress,{size:"small"}):e.jsx(t.AutoAwesomeIcon,{})})}),e.jsx(t.Tooltip,{title:"Add new property",children:e.jsx(t.Button,{variant:"outlined",onClick:()=>A(!0),children:e.jsx(t.AddIcon,{})})})]})]}),e.jsx(t.ErrorBoundary,{children:e.jsx(fe,{className:"pl-8",onPropertyClick:(N,q)=>{C(E.indexOf(N)),D(N),I(q)},inferredPropertyKeys:$,selectedPropertyKey:T?H(T,F):void 0,properties:s.properties,propertiesOrder:E,onPropertyMove:ue,onPropertyRemove:r?me:void 0,errors:a?y:{}})}),e.jsx(t.Button,{className:"mt-8 w-full",color:"primary",variant:"outlined",size:"large",onClick:()=>A(!0),startIcon:e.jsx(t.AddIcon,{}),children:"Add new property"})]}),!h&&e.jsx("div",{className:"col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20",children:e.jsxs(t.Paper,{className:"sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",children:[B&&P&&!t.isPropertyBuilder(P)&&e.jsx(Ke,{inArray:!1,existing:!r,autoUpdateId:!1,allowDataInference:!r,autoOpenTypeSelect:!1,propertyKey:T,propertyNamespace:F,property:P,onPropertyChanged:G,onDelete:me,onError:le,forceShowErrors:a,initialErrors:we,getData:m},`edit_view_${w}`),!P&&e.jsx(t.Typography,{variant:"label",className:"flex items-center justify-center h-full",children:O?"Now you can add your first property":"Select a property to edit it"}),P&&t.isPropertyBuilder(P)&&e.jsx("div",{className:"flex items-center justify-center",children:"This property cannot be edited"})]})}),h&&e.jsx(pe,{inArray:!1,open:w!==void 0,autoUpdateId:r,allowDataInference:!r,existing:!0,autoOpenTypeSelect:!1,propertyKey:T,propertyNamespace:F,property:P,onPropertyChanged:G,onDelete:me,onError:le,forceShowErrors:a,initialErrors:we,getData:m,onOkClicked:h?Ie:void 0},`edit_view_${w}`)]});return e.jsxs(e.Fragment,{children:[_e,e.jsx(pe,{inArray:!1,existing:!1,autoOpenTypeSelect:!0,autoUpdateId:!0,forceShowErrors:a,open:U,onCancel:()=>A(!1),onPropertyChanged:he,getData:m,allowDataInference:!r,existingPropertyKeys:s.propertiesOrder})]})}function At({open:a,handleOk:r,handleCancel:i,body:o,title:c}){return e.jsxs(t.Dialog,{open:a,onOpenChange:p=>p?i():r(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.jsxs(t.DialogContent,{children:[e.jsx(t.Typography,{variant:"h6",children:c??"Unsaved changes"}),o&&e.jsx(t.Typography,{children:o}),e.jsx(t.Typography,{children:"Are you sure?"})]}),e.jsxs(t.DialogActions,{children:[e.jsx(t.Button,{variant:"text",onClick:i,autoFocus:!0,children:" Cancel "}),e.jsx(t.Button,{onClick:r,children:" Ok "})]})]})}function zt({collection:a,parentCollection:r,configController:i,collectionInference:o,getUser:c,parentPathSegments:p}){const[l,d]=g.useState(),[m,b]=g.useState(),{values:s}=u.useFormikContext(),n=a.subcollections??[];return e.jsxs("div",{className:"overflow-auto my-auto",children:[e.jsx(t.Container,{maxWidth:"xl",className:"flex flex-col gap-4 p-8 m-auto",children:e.jsxs("div",{className:"flex flex-col gap-8 items-start",children:[e.jsxs(t.Typography,{variant:"h5",children:["Subcollections of ",s.name]}),n&&n.length>0&&e.jsx(t.Paper,{className:"flex flex-col gap-4 p-2 w-full",children:e.jsx(t.Table,{children:e.jsx(t.TableBody,{children:n.map(f=>e.jsxs(t.TableRow,{onClick:()=>b({isNewCollection:!1,editedCollectionPath:f.path}),children:[e.jsx(t.TableCell,{align:"left",children:e.jsx(t.Typography,{variant:"subtitle2",className:"flex-grow",children:f.name})}),e.jsx(t.TableCell,{align:"right",children:e.jsx(t.Tooltip,{title:"Remove",children:e.jsx(t.IconButton,{size:"small",onClick:v=>{v.preventDefault(),v.stopPropagation(),d(f.path)},color:"inherit",children:e.jsx(t.DeleteIcon,{size:"small"})})})})]},f.path))})})}),e.jsx(t.Button,{onClick:()=>{b({isNewCollection:!0})},variant:"outlined",startIcon:e.jsx(t.AddIcon,{}),children:"Add subcollection"})]})}),l&&e.jsx(t.DeleteConfirmationDialog,{open:!!l,onAccept:()=>{i.deleteCollection({path:l,parentPathSegments:[...p??[],a.path]}),d(void 0)},onCancel:()=>d(void 0),title:e.jsx(e.Fragment,{children:"Delete this subcollection?"}),body:e.jsxs(e.Fragment,{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only the collection in the CMS"]})}),e.jsx(Qe,{open:!!m,configController:i,parentCollection:a,collectionInference:o,parentPathSegments:[...p??[],s.path],isNewCollection:!1,...m,getUser:c,handleClose:f=>{b(void 0)}})]})}const Ye=t.buildCollection({path:"products",name:"Products",singularName:"Product",group:"Main",icon:"shopping_cart",description:"List of the products currently sold in your shop",properties:{name:{dataType:"string",name:"Name",description:"Name of this product",validation:{required:!0}},brand:{dataType:"string",name:"Brand",validation:{required:!0}},description:{dataType:"string",name:"Description",description:"Description of this product, supports markdown",markdown:!0},main_image:{dataType:"string",name:"Image",storage:{storagePath:"images",acceptedFiles:["image/*"]},description:"Upload field for images"},available:{dataType:"boolean",name:"Available",columnWidth:100,description:"Is this product available in the website"},price:{dataType:"number",name:"Price",validation:{requiredMessage:"You must set a positive price",min:0}},images:{dataType:"array",name:"Images",hideFromCollection:!0,of:{dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"]}}},related_products:{dataType:"array",name:"Related products",description:"Products related to this one",of:{dataType:"reference",path:"products"}},metadata:{name:"Metadata",description:"This is an example of a map property",dataType:"map",keyValue:!0},added_on:{dataType:"date",name:"Added on",autoValue:"on_create"}}}),Ge=t.buildCollection({path:"blog",name:"Blog",singularName:"Blog entry",group:"Content",icon:"article",description:"A collection of blog entries",defaultSize:"l",properties:{name:t.buildProperty({name:"Name",validation:{required:!0},dataType:"string"}),header_image:t.buildProperty({name:"Header image",dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"],metadata:{cacheControl:"max-age=1000000"}}}),content:t.buildProperty({name:"Content",description:"Content blocks for the blog entry",validation:{required:!0},dataType:"array",oneOf:{typeField:"type",valueField:"value",properties:{text:{dataType:"string",name:"Text",markdown:!0},quote:{dataType:"string",name:"Quote",multiline:!0},images:{name:"Images",dataType:"array",of:{dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"],metadata:{cacheControl:"max-age=1000000"}}},description:"This fields allows uploading multiple images at once and reordering"},products:{name:"Products",dataType:"array",of:{dataType:"reference",path:"products",previewProperties:["name","main_image"]}}},propertiesOrder:["text","quote","images","products"]}}),created_on:{name:"Created on",dataType:"date",autoValue:"on_create"},status:{name:"Status",validation:{required:!0},dataType:"string",enumValues:{published:{id:"published",label:"Published"},draft:"Draft"},defaultValue:"draft"},publish_date:{name:"Publish date",dataType:"date",clearable:!0},reviewed:{name:"Reviewed",dataType:"boolean"},tags:{name:"Tags",description:"Example of generic array",dataType:"array",of:{dataType:"string",previewAsTag:!0}}},initialFilter:{status:["==","published"]}}),He=t.buildCollection({path:"users",name:"Users",singularName:"User",group:"Main",description:"Registered users in the app/web",icon:"person",properties:{displayName:{name:"Display name",dataType:"string"},email:{name:"Email",dataType:"string",email:!0},emailVerified:{name:"Email verified",dataType:"boolean"},phone:{name:"Phone",dataType:"string"},photoURL:{name:"Photo URL",dataType:"string",url:"image"}}});function Dt({path:a,pathSuggestions:r,parentCollection:i,onContinue:o,collections:c}){const[p,l]=g.useState(!1),[d,m]=g.useState();g.useEffect(()=>{r&&c&&(l(!0),r(a).then(h=>{const w=h.filter(C=>!c.find(T=>T.path.trim().toLowerCase()===C.trim().toLowerCase()));m(w)}).finally(()=>l(!1)))},[c,a,r]);const{values:b,setFieldValue:s,setValues:n,handleChange:f,touched:v,errors:y,setFieldTouched:x,isSubmitting:_,submitCount:k}=u.useFormikContext();return e.jsx("div",{className:"overflow-auto my-auto",children:e.jsxs(t.Container,{maxWidth:"4xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsx("div",{className:"flex flex-row py-2 pt-3 items-center",children:e.jsx(t.Typography,{variant:"h4",className:"flex-grow",children:"New collection"})}),i&&e.jsx(t.Chip,{colorScheme:"tealDarker",children:e.jsxs(t.Typography,{variant:"caption",children:["This is a subcollection of ",e.jsx("b",{children:i.name})]})}),e.jsxs("div",{className:"my-2",children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",children:"● Use one of the existing paths in your database:"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7",children:[p&&!d&&e.jsx(t.CircularProgress,{size:"small"}),d?.map((h,w)=>e.jsx(t.Chip,{colorScheme:"cyanLighter",onClick:()=>{s("name",t.unslugify(h)),s("path",h),s("properties",void 0),o()},size:"small",children:h},h)),!p&&d?.length===0&&e.jsx(t.Typography,{variant:"caption",children:"No suggestions"})]})]}),e.jsxs("div",{className:"my-2",children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",children:"● Select a template:"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(Oe,{title:"Products",subtitle:"A collection of products with images, prices and stock",icon:e.jsx(t.Icon,{size:"small",iconKey:Ye.icon}),onClick:()=>{n(Ye),o()}}),e.jsx(Oe,{title:"Blog posts",subtitle:"A collection of blog posts with images, authors and complex content",icon:e.jsx(t.Icon,{size:"small",iconKey:Ge.icon}),onClick:()=>{n(Ge),o()}}),e.jsx(Oe,{title:"Users",subtitle:"A collection of users with emails, names and roles",icon:e.jsx(t.Icon,{size:"small",iconKey:He.icon}),onClick:()=>{n(He),o()}})]})]}),!i&&e.jsxs("div",{children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",className:"mb-2",children:"● Create a collection from a file (csv, json, xls, xslx...)"}),e.jsx(te.ImportFileUpload,{onDataAdded:h=>o(h)})]}),e.jsx("div",{children:e.jsx(t.Button,{variant:"text",onClick:()=>o(),className:"my-2",children:"Continue from scratch"})})]})})}function Oe({title:a,subtitle:r,icon:i,onClick:o}){return e.jsx(t.Tooltip,{title:r,children:e.jsxs(t.Card,{onClick:o,className:t.cn("my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center","text-gray-700 dark:text-gray-300","hover:border-blue-600 hover:text-blue-600 dark:hover:text-blue-400 focus:ring-blue-400 hover:ring-1 hover:ring-primary","border-gray-400 dark:border-gray-600 "),children:[i,e.jsx("div",{className:"flex flex-col items-start",children:e.jsx(t.Typography,{variant:"subtitle1",children:a})})]})})}function Et({importConfig:a}){const{setFieldValue:r,setFieldTouched:i,values:o}=u.useFormikContext(),[c,p]=g.useState(void 0),l=g.useRef(o.propertiesOrder?{"":o.propertiesOrder}:{}),d=c?c.id:void 0,m=c||void 0,b=({id:n,property:f,previousId:v,namespace:y})=>{const x=n?H(n,y):void 0,_=x?J(x):void 0,k=w=>w?l.current[w]??u.getIn(o,ae(w)):l.current[""],h=(w,C)=>{const T=ae(C);r(T,w,!1),l.current[C??""]=w};if(v&&v!==n){const w=H(v,y),C=J(w),D=k(y).map(I=>I===v?n:I).filter(I=>I!==void 0);h(D,y);const F={...a.headersMapping};Object.keys(F).forEach(I=>{F[I]===v&&(F[I]=n??"")}),a.setHeadersMapping(F),r(C,void 0,!1),i(C,!1,!1)}_&&(r(_,f,!1),i(_,!0,!1))},s=async({id:n,importKey:f,property:v,namespace:y})=>{const x=n?H(n,y):void 0,_=x?J(x):void 0,k=a.importData.map(w=>u.getIn(w,f)),h=xe.buildPropertyFromData(k,v,te.getInferenceType);_&&(h?(console.log("updating inferredNewProperty",{property:v,inferredNewProperty:h}),r(_,h,!1)):r(_,v,!1),i(_,!0,!1))};return e.jsxs("div",{className:"overflow-auto my-auto bg-gray-50 dark:bg-gray-900",children:[e.jsxs(t.Container,{maxWidth:"6xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsx(t.Typography,{variant:"h6",className:"mt-4",children:"Data property mapping"}),e.jsx(te.DataNewPropertiesMapping,{headersMapping:a.headersMapping,idColumn:a.idColumn,originProperties:a.originProperties,destinationProperties:o.properties,onIdPropertyChanged:n=>a.setIdColumn(n),buildPropertyView:({property:n,propertyKey:f,importKey:v})=>e.jsx(te.ImportNewPropertyFieldPreview,{property:n,propertyKey:f,onPropertyNameChanged:(y,x)=>r(`properties.${y}.name`,x,!1),onEditClick:()=>{!f||!n||p({...n,id:f,editable:!0})},propertyTypeView:e.jsx(Vt,{property:n,onPropertyChanged:y=>s({...y,importKey:v}),propertyKey:f})})})]}),e.jsx(pe,{open:c!==void 0,propertyKey:d,property:m,inArray:!1,autoUpdateId:!1,onPropertyChanged:b,allowDataInference:!1,onOkClicked:()=>{p(void 0)},onCancel:()=>{p(void 0)},autoOpenTypeSelect:!1,existing:!1}),e.jsx("div",{style:{height:"52px"}})]})}function Vt({property:a,onPropertyChanged:r,propertyKey:i}){const o=a?t.getFieldId(a):null,c=a?t.getFieldConfig(a):null,[p,l]=g.useState(!1);return e.jsx(t.Tooltip,{title:a&&c?`${c?.name} - ${a.dataType}`:void 0,open:p?!1:void 0,children:e.jsx(t.Select,{open:p,onOpenChange:l,invisible:!0,className:"w-full",error:!c,value:o??"",placeholder:"Select a property widget",position:"item-aligned",renderValue:d=>c?e.jsx(t.FieldConfigBadge,{widget:c}):null,onValueChange:d=>{const m=$e(a,d);i&&(r({id:i,property:m,previousId:i,namespace:void 0}),console.log("newSelectedWidgetId",d))},children:Se.map(([d,m])=>e.jsx(Le,{value:d,optionDisabled:!1,widget:m,existing:!1},d))})})}function Bt({importConfig:a,properties:r,propertiesOrder:i}){g.useEffect(()=>{const c=te.getPropertiesMapping(a.originProperties,r),p=a.importData.map(l=>te.convertDataToEntity(l,a.idColumn,a.headersMapping,r,c,"TEMP_PATH"));a.setEntities(p),console.log("res",{propertiesMapping:c,mappedData:p})},[]);const o=t.useSelectionController();return e.jsx(t.EntityCollectionTable,{title:e.jsxs("div",{children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Imported data preview"}),e.jsx(t.Typography,{variant:"caption",children:"Entities with the same id will be overwritten"})]}),tableController:{data:a.entities,dataLoading:!1,noMoreToLoad:!1},endAdornment:e.jsx("div",{className:"h-12"}),filterable:!1,sortable:!1,selectionController:o,displayedColumnIds:i.map(c=>({key:c,disabled:!1})),properties:r})}function We(a,r=""){const i=Object.keys(a).reduce((p,l)=>{const d=a[l],m=t.slugify(l),b=r?`${r}.${m}`:m;if(d.dataType==="map"&&d.properties){const f=We(d.properties,b);return{headersMapping:{...p.headersMapping,[l]:b},properties:{...p.properties,[m]:{...d,properties:f.properties,propertiesOrder:Object.keys(f.properties)}}}}const s={...p.properties,[m]:d};return{headersMapping:{...p.headersMapping,[l]:b},properties:s}},{headersMapping:{},properties:{}}),o=Object.keys(i.headersMapping)?.[0];let c;return(o?.includes("id")||o?.includes("key"))&&(c=o),{...i,idColumn:c}}function Qe(a){const r=a.open,[i,o]=X.useState(!1),[c,p]=X.useState(!1),l=g.useCallback(()=>{i?p(!0):a.handleClose(void 0)},[i,a.handleClose]);return g.useEffect(()=>{r||(o(!1),p(!1))},[r]),e.jsxs(t.Dialog,{open:r,fullWidth:!0,fullHeight:!0,scrollable:!1,maxWidth:"7xl",onOpenChange:d=>d?void 0:l(),children:[r&&e.jsx(jt,{...a,handleCancel:l,setFormDirty:o}),e.jsx(At,{open:c,handleOk:()=>a.handleClose(void 0),handleCancel:()=>p(!1),body:"There are unsaved changes in this collection"})]})}function jt({isNewCollection:a,group:r,configController:i,editedCollectionPath:o,parentPathSegments:c,fullPath:p,collectionInference:l,handleClose:d,reservedGroups:m,extraView:b,handleCancel:s,setFormDirty:n,pathSuggestions:f,getUser:v,parentCollection:y,getData:x}){const _=t.useNavigationContext(),{topLevelNavigation:k,collections:h}=_,w=(c??[]).length===0,C=(y?y.subcollections:h)??[],T=C.map(O=>O.path.trim().toLowerCase()),D=C.map(O=>O.alias?.trim().toLowerCase()).filter(Boolean),F=te.useImportConfig();if(!k)throw Error("Internal: Navigation not ready in collection editor");const{groups:I}=k,B=t.useSnackbarController(),P=t.useAuthController(),M=g.useRef({}),[S,U]=g.useState(a?w?"welcome":"details":"properties"),[A,$]=X.useState(),[W,K]=X.useState(),[oe,ne]=X.useState(!1),[se,me]=X.useState();g.useEffect(()=>{try{_.initialised&&(K(o?_.getCollectionFromPaths([...c??[],o]):void 0),ne(!0))}catch(O){console.error(O),me(se)}},[_.getCollectionFromPaths,o,se,_.initialised]);const ue=O=>{const E=O.alias||O.path;return i.saveCollection({path:E,collectionData:O,previousPath:o,parentPathSegments:c}).then(()=>($(void 0),!0)).catch(z=>($(z),console.error(z),B.open({type:"error",message:"Error persisting collection: "+(z.message??"Details in the console")}),!1))},he=W??{path:"",name:"",group:r,properties:{},propertiesOrder:[],icon:t.coolIconKeys[Math.floor(Math.random()*t.coolIconKeys.length)],ownerId:P.user?.uid??""},G=g.useCallback(()=>{S==="details"?F.inUse?U("import_data_saving"):U(b?"extra_view":"properties"):U(S==="welcome"?"details":S==="import_data_mapping"?"import_data_preview":S==="import_data_preview"?"details":S==="extra_view"?"properties":"details")},[S,F.inUse,b]),le=g.useCallback(O=>{if(l)return l?.(O.path,O.collectionGroup??!1,c??[])},[l,c]),Ie=g.useCallback(async O=>{if(!le)return K(O),Promise.resolve(O);U("loading");const E=await le?.(O);if(!E)return K(O),Promise.resolve(O);const z={...O??{}};return Object.keys(E.properties??{}).length>0&&(z.properties=E.properties,z.propertiesOrder=E.propertiesOrder),z.propertiesOrder?(K(z),console.log("Inferred collection",{newCollection:O??{},values:z}),z):(z.propertiesOrder=Object.keys(z.properties),z)},[c,le]),we=(O,E)=>{try{if(console.log("Submitting collection",O),!a){ue(O).then(()=>{E.resetForm({values:he}),G(),d(O)});return}S==="welcome"?(G(),E.resetForm({values:O})):S==="details"?b||F.inUse?(E.resetForm({values:O}),G()):a?Ie(O).then(z=>{E.resetForm({values:z??O,touched:{path:!0,name:!0}})}).finally(()=>{G()}):(E.resetForm({values:O}),G()):S==="extra_view"?(G(),E.resetForm({values:O})):S==="import_data_mapping"||S==="import_data_preview"?G():S==="properties"?ue(O).then(()=>{E.resetForm({values:he}),G(),d(O)}):(G(),E.resetForm({values:O}))}catch(z){B.open({type:"error",message:"Error persisting collection: "+(z.message??"Details in the console")}),console.error(z),E.resetForm({values:O})}};return!a&&(!_.initialised||!oe)?e.jsx(t.CircularProgressCenter,{}):e.jsx(t.DialogContent,{fullHeight:!0,children:e.jsx(u.Formik,{initialValues:he,validationSchema:(S==="properties"||S==="subcollections"||S==="details")&&tt,validate:()=>{if(S==="properties")return M.current},onSubmit:we,children:({values:O,setFieldValue:E,isSubmitting:z,dirty:_e,submitCount:N})=>{const q=O.path??o,V=p?.includes("/")?p?.split("/").slice(0,-1).join("/")+"/"+q:q,Z=V&&x?()=>x(V):void 0;g.useEffect(()=>{n(_e)},[_e]);function Q(L){F.setInUse(!0),xe.buildEntityPropertiesFromData(L,te.getInferenceType).then(Ae=>{const ee=We(Ae);E("properties",ee.properties),E("propertiesOrder",Object.keys(ee.properties)),F.setIdColumn(ee.idColumn),F.setImportData(L),F.setHeadersMapping(ee.headersMapping),F.setOriginProperties(ee.properties)})}const R=!!O.name&&!!O.path,qe=()=>{const L={...O.properties};F.idColumn&&delete L[F.idColumn],E("properties",L),G(),console.log("onImportMappingComplete",{importConfig:F,properties:L})};return e.jsxs(e.Fragment,{children:[!a&&e.jsxs(t.Tabs,{value:S,className:t.cn(t.defaultBorderMixin,"justify-end bg-gray-50 dark:bg-gray-950 border-b"),onValueChange:L=>U(L),children:[e.jsx(t.Tab,{value:"details",children:"Details"}),e.jsx(t.Tab,{value:"properties",children:"Properties"}),e.jsx(t.Tab,{value:"subcollections",children:"Subcollections"})]}),e.jsxs(u.Form,{noValidate:!0,className:t.cn(a?"h-full":"h-[calc(100%-48px)]","flex-grow flex flex-col relative"),children:[S==="loading"&&e.jsx(t.CircularProgressCenter,{}),S==="extra_view"&&q&&b?.View&&e.jsx(b.View,{path:q}),S==="welcome"&&e.jsx(Dt,{path:q,onContinue:L=>{L?(Q(L),U("import_data_mapping")):U("details")},collections:h,parentCollection:y,pathSuggestions:f}),S==="import_data_mapping"&&F&&e.jsx(Et,{importConfig:F}),S==="import_data_preview"&&F&&e.jsx(Bt,{importConfig:F,properties:O.properties,propertiesOrder:O.propertiesOrder}),S==="import_data_saving"&&F&&e.jsx(te.ImportSaveInProgress,{importConfig:F,collection:O,onImportSuccess:L=>{d(L),B.open({type:"info",message:"Data imported successfully"})}}),S==="details"&&e.jsx(it,{existingPaths:T,existingAliases:D,groups:I,parentCollection:y,isNewCollection:a}),S==="subcollections"&&W&&e.jsx(zt,{parentCollection:y,configController:i,getUser:v,collectionInference:l,parentPathSegments:c,collection:W}),S==="properties"&&e.jsx(qt,{showErrors:N>0,isNewCollection:a,reservedGroups:m,onPropertyError:(L,Ae,ee)=>{M.current=t.removeUndefined({...M.current,[L]:ee},!0)},getUser:v,getData:Z,doCollectionInference:le,extraIcon:b?.icon&&e.jsx(t.IconButton,{color:"primary",onClick:()=>U("extra_view"),children:b.icon})}),S!=="welcome"&&e.jsxs(t.DialogActions,{position:"absolute",children:[A&&e.jsx(t.ErrorView,{error:A}),a&&w&&S==="import_data_mapping"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>(F.setInUse(!1),U("welcome")),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),a&&w&&S==="import_data_preview"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>{ue(O),U("import_data_mapping")},children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),a&&w&&S==="details"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>U("welcome"),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),a&&S==="properties"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>U("details"),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),e.jsx(t.Button,{variant:"text",onClick:()=>{s()},children:"Cancel"}),a&&S==="import_data_mapping"&&e.jsx(t.Button,{variant:"filled",color:"primary",onClick:qe,children:"Next"}),a&&S==="import_data_preview"&&e.jsx(t.Button,{variant:"filled",color:"primary",onClick:()=>{G()},children:"Next"}),a&&(S==="details"||S==="properties")&&e.jsxs(t.LoadingButton,{variant:"filled",color:"primary",type:"submit",loading:z,disabled:z||S==="details"&&!R,startIcon:S==="properties"?e.jsx(t.DoneIcon,{}):void 0,children:[S==="details"&&"Next",S==="properties"&&"Create collection"]}),!a&&e.jsx(t.LoadingButton,{variant:"filled",color:"primary",type:"submit",loading:z,children:"Update collection"})]})]})]})}})})}const Ze=g.createContext({}),Xe=g.createContext({}),Mt=g.memo(function({children:r,collectionConfigController:i,configPermissions:o,reservedGroups:c,collectionInference:p,extraView:l,pathSuggestions:d,getUser:m,getData:b}){const s=t.useNavigationContext(),n=et.useNavigate(),[f,v]=g.useState(),y=g.useCallback(()=>({createCollections:!0,editCollections:!0,deleteCollections:!0}),[]),x=g.useCallback(({path:k,fullPath:h,parentPathSegments:w,parentCollection:C})=>{v({editedCollectionPath:k,fullPath:h,parentPathSegments:w,isNewCollection:!1,parentCollection:C})},[]),_=g.useCallback(({group:k,parentPathSegments:h,parentCollection:w})=>{v({group:k,isNewCollection:!0,parentPathSegments:h,parentCollection:w})},[]);return e.jsx(Ze.Provider,{value:i,children:e.jsxs(Xe.Provider,{value:{editCollection:x,createCollection:_,configPermissions:o??y},children:[r,e.jsx(Qe,{open:!!f,configController:i,isNewCollection:!1,collectionInference:p,...f,getData:b,reservedGroups:c,extraView:l,pathSuggestions:d,getUser:m,handleClose:k=>{if(k&&f?.isNewCollection&&!f.parentPathSegments.length){const h=s.buildUrlCollectionPath(k.alias??k.path);n(h)}v(void 0)}})]})})},ge),ye=()=>g.useContext(Xe),Ne=()=>g.useContext(Ze);function Ut({path:a,parentPathSegments:r,collection:i,tableController:o}){const c=t.useAuthController(),p=t.useNavigationContext(),l=ye(),d=Ne(),m=t.useSnackbarController(),b=p.getCollectionFromPaths(r),s=l.configPermissions?l.configPermissions({user:c.user,collection:i}).editCollections:!0;let n=null;(!ge(ve(o.filterValues),ve(i.initialFilter))||!ge(ve(o.sortBy),ve(i.initialSort)))&&(n=e.jsx(t.Tooltip,{title:o.sortBy||o.filterValues?"Save default filter and sort":"Clear default filter and sort",children:e.jsx(t.Button,{color:"primary",size:"small",variant:"outlined",onClick:()=>d?.saveCollection({path:i.path,parentPathSegments:r,collectionData:t.mergeDeep(i,{initialFilter:o.filterValues??null,initialSort:o.sortBy??null})}).then(()=>{m.open({type:"success",message:"Default config saved"})}),children:e.jsx(t.SaveIcon,{})})}));const f=e.jsx(t.Tooltip,{title:s?"Edit collection":"You don't have permissions to edit this collection",children:e.jsx(t.IconButton,{color:"primary",disabled:!s,onClick:s?()=>l?.editCollection({path:i.path,fullPath:a,parentPathSegments:r,parentCollection:b}):void 0,children:e.jsx(t.SettingsIcon,{})})});return e.jsxs(e.Fragment,{children:[s&&n,f]})}function ve(a){return a&&Object.keys(a).length===0?a:a??null}function $t({path:a,collection:r}){const i=t.useAuthController(),o=Ne(),c=ye(),p=c.configPermissions({user:i.user,collection:r}),l=g.useCallback(()=>{c?.editCollection({path:a,parentPathSegments:[]})},[c,a]),[d,m]=g.useState(!1),b=g.useCallback(()=>{o?.deleteCollection({path:a})},[a,o]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[p.deleteCollections&&e.jsx(t.Menu,{trigger:e.jsx(t.IconButton,{children:e.jsx(t.MoreVertIcon,{size:"small"})}),children:e.jsxs(t.MenuItem,{onClick:s=>{s.preventDefault(),s.stopPropagation(),m(!0)},children:[e.jsx(t.DeleteIcon,{}),"Delete"]})}),p.editCollections&&e.jsx(t.IconButton,{onClick:s=>{l()},children:e.jsx(t.SettingsIcon,{size:"small"})})]}),e.jsx(t.DeleteConfirmationDialog,{open:d,onAccept:b,onCancel:()=>m(!1),title:e.jsx(e.Fragment,{children:"Delete this collection?"}),body:e.jsxs(e.Fragment,{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only the collection in the CMS"]})})]})}function Lt({group:a,context:r}){if(!r.navigation.topLevelNavigation)throw Error("Navigation not ready in FireCMSHomePage");const i=t.useAuthController(),o=ye(),c=o.configPermissions?o.configPermissions({user:i.user}).createCollections:!0;return e.jsx(t.Card,{className:t.cn("h-full p-4 min-h-[124px]"),onClick:o&&c?()=>o.createCollection({group:a,parentPathSegments:[]}):void 0,children:e.jsxs("div",{className:"flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",children:[e.jsx(t.AddIcon,{color:"primary"}),e.jsx(t.Typography,{color:"primary",variant:"caption",className:"font-medium",children:"Add new collection".toUpperCase()}),!c&&e.jsx(t.Typography,{variant:"caption",children:"You don't have permissions to create collections"})]})})}function Kt({collectionConfigController:a,configPermissions:r,reservedGroups:i,extraView:o,pathSuggestions:c,getUser:p,collectionInference:l,getData:d}){const m=g.useCallback(b=>t.joinCollectionLists(a.collections??[],b),[a.collections]);return{name:"Collection Editor",loading:a.loading,collections:{injectCollections:m,CollectionActions:Ut},provider:{Component:Mt,props:{collectionConfigController:a,configPermissions:r,collectionInference:l,reservedGroups:i,extraView:o,pathSuggestions:c,getUser:p,getData:d}},homePage:{CollectionActions:$t,AdditionalCards:Lt}}}j.editableProperty=de,j.removeNonEditableProperties=je,j.useCollectionEditorController=ye,j.useCollectionEditorPlugin=Kt,j.useCollectionsConfigController=Ne,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(q,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("@firecms/core"),require("react"),require("react-fast-compare"),require("@firecms/ui"),require("formik"),require("yup"),require("@firecms/schema_inference"),require("@hello-pangea/dnd"),require("json5"),require("prism-react-renderer"),require("@firecms/data_import_export"),require("react-router")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@firecms/core","react","react-fast-compare","@firecms/ui","formik","yup","@firecms/schema_inference","@hello-pangea/dnd","json5","prism-react-renderer","@firecms/data_import_export","react-router"],e):(q=typeof globalThis<"u"?globalThis:q||self,e(q.FireCMS={},q.jsxRuntime,q.core,q.React,q.equal,q.ui,q.formik,q.Yup,q.schema_inference,q.dnd,q.JSON5,q.prismReactRenderer,q.data_import_export,q.reactRouter))})(this,function(q,e,i,C,xe,t,g,cr,De,_e,pr,ze,se,hr){"use strict";function Ue(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const l in r)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(a,l,o.get?o:{enumerable:!0,get:()=>r[l]})}}return a.default=r,Object.freeze(a)}const me=Ue(C),Fe=Ue(cr),fr=Fe.object().shape({id:Fe.string().required("Required"),name:Fe.string().required("Required"),path:Fe.string().required("Required")});function H({error:r,children:a}){return a?e.jsx(t.Typography,{variant:"caption",color:r?"error":"secondary",className:"ml-3.5 mt-0.5",children:a}):null}function gr({isNewCollection:r,reservedGroups:a,existingPaths:l,existingIds:o,groups:s,parentCollection:n}){const d=C.useRef(null),{values:h,setFieldValue:f,handleChange:u,touched:c,errors:p,setFieldTouched:T,isSubmitting:m,submitCount:b}=g.useFormikContext(),[N,F]=C.useState(!1),[w,y]=C.useState(!1),P=O=>{f("name",O),!g.getIn(c,"path")&&r&&O&&f("path",i.toSnakeCase(O)),!g.getIn(c,"id")&&r&&O&&f("id",i.toSnakeCase(O)),!g.getIn(c,"singularName")&&r&&O&&f("singularName",i.singular(O))};C.useEffect(()=>{p.id&&y(!0)},[p.id]);const x=e.jsx(i.IconForView,{collectionOrView:h}),v=s?.filter(O=>!a?.includes(O)),{inputFocused:E,autoCompleteOpen:U,setAutoCompleteOpen:D}=t.useAutoComplete({ref:d}),V=!!n;let L;return e.jsx("div",{className:"overflow-auto my-auto",children:e.jsxs(t.Container,{maxWidth:"4xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-row py-2 pt-3 items-center",children:[e.jsx(t.Typography,{variant:r?"h4":"h5",className:"flex-grow",children:r?"New collection":`${h?.name} collection`}),e.jsx(t.Tooltip,{title:"Change icon",children:e.jsx(t.IconButton,{shape:"square",onClick:()=>F(!0),children:x})})]}),n&&e.jsx(t.Chip,{colorScheme:"tealDarker",children:e.jsxs(t.Typography,{variant:"caption",children:["This is a subcollection of ",e.jsx("b",{children:n.name})]})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{value:h.name??"",onChange:O=>P(O.target.value),label:"Name",required:!0,error:c.name&&!!p.name}),e.jsx(H,{error:c.name&&!!p.name,children:c.name&&p.name?p.name:"Name of in this collection, usually a plural name (e.g. Products)"})]}),e.jsxs("div",{className:t.cn("col-span-12 ",V?"":"sm:col-span-8"),children:[e.jsx(g.Field,{name:"path",as:t.DebouncedTextField,label:"Path",disabled:!r,required:!0,error:c.path&&!!p.path}),e.jsx(H,{error:c.path&&!!p.path,children:c.path&&p.path?p.path:V?"Relative path to the parent (no need to include the parent path)":"Path that this collection is stored in, in the database"})]}),!V&&e.jsxs("div",{className:"col-span-12 sm:col-span-4 relative",children:[e.jsx(t.TextField,{error:c.group&&!!p.group,disabled:m,value:h.group??"",autoComplete:"off",onChange:O=>f("group",O.target.value),name:"group",inputRef:d,label:"Group"}),e.jsx(t.Autocomplete,{open:U&&(v??[]).length>0,setOpen:D,children:v?.map((O,S)=>e.jsx(t.AutocompleteItem,{onClick:()=>{D(!1),f("group",O??null)},children:e.jsx("div",{className:"flex-grow",children:O})},S+"_"+O))}),e.jsx(H,{children:c.group&&p.group?p.group:"Group of the collection"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.ExpandablePanel,{expanded:w,onExpandedChange:y,title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.SettingsIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"Advanced"})]}),initiallyExpanded:!1,children:e.jsxs("div",{className:"grid grid-cols-12 gap-4 p-4",children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(g.Field,{name:"id",as:t.DebouncedTextField,disabled:!r,label:"Collection id",error:c.id&&!!p.id}),e.jsx(H,{error:c.id&&!!p.id,children:c.id&&p.id?p.id:"This id identifies this collection"})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{error:c.singularName&&!!p.singularName,id:"singularName","aria-describedby":"singularName-helper",onChange:O=>(T("singularName",!0),u(O)),value:h.singularName??"",label:"Singular name"}),e.jsx(H,{error:c.singularName&&!!p.singularName,children:c.singularName&&p.singularName?p.singularName:"Optionally define a singular name for your entities"})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.TextField,{error:c.description&&!!p.description,id:"description",value:h.description??"",onChange:u,multiline:!0,rows:2,"aria-describedby":"description-helper-text",label:"Description"}),e.jsx(H,{error:c.description&&!!p.description,children:c.description&&p.description?p.description:"Description of the collection, you can use markdown"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.Select,{name:"defaultSize",label:"Default row size",position:"item-aligned",onChange:u,value:h.defaultSize??"",renderValue:O=>O.toUpperCase(),children:["xs","s","m","l","xl"].map(O=>e.jsx(t.SelectItem,{value:O,children:O.toUpperCase()},`size-select-${O}`))})}),e.jsx("div",{className:"col-span-12",children:e.jsxs(t.Select,{name:"customId",label:"Data IDs generation",position:"item-aligned",disabled:L==="code_defined",onValueChange:O=>{if(O==="code_defined")throw new Error("This should not happen");O==="true"?f("customId",!0):O==="false"?f("customId",!1):O==="optional"&&f("customId","optional")},value:"",renderValue:O=>O==="code_defined"?"Code defined":O==="true"?"Users must define an ID":O==="optional"?"Users can define an ID, but it is not required":"Document ID is generated automatically",children:[e.jsx(t.SelectItem,{value:"false",children:"Document ID is generated automatically"}),e.jsx(t.SelectItem,{value:"true",children:"Users must define an ID"}),e.jsx(t.SelectItem,{value:"optional",children:"Users can define an ID, but it is not required"})]})}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.BooleanSwitchWithLabel,{position:"start",label:"Collection group",onValueChange:O=>f("collectionGroup",O),value:h.collectionGroup??!1}),e.jsx(H,{children:"A collection group consists of all collections with the same path. This allows you to query over multiple collections at once."})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.BooleanSwitchWithLabel,{position:"start",label:"Enable text search for this collection",onValueChange:O=>f("textSearchEnabled",O),value:h.textSearchEnabled??!1}),e.jsx(H,{children:"Allow text search for this collection. If you have not specified a text search delegate, this will use the built-in local text search. This is not recommended for large collections, as it may incur in performance and cost issues."})]})]})})})]}),e.jsx("div",{style:{height:"52px"}}),e.jsx(t.Dialog,{open:N,onOpenChange:F,maxWidth:"xl",fullWidth:!0,children:e.jsx("div",{className:"p-4 overflow-auto min-h-[200px]",children:e.jsx(i.SearchIconsView,{selectedIcon:h.icon,onIconSelected:O=>{F(!1),f("icon",O)}})})})]})})}function te(r){return"properties."+r.replaceAll(".",".properties.")}function qe(r){return r?"properties."+r.replaceAll(".",".properties.")+".properties":"properties"}function oe(r){return r?"properties."+r.replaceAll(".",".properties.")+".propertiesOrder":"propertiesOrder"}function K(r,a){return a?`${a}.${r}`:r}const ur=C.memo(function({enumValues:a,onValuesChanged:l,onError:o,updateIds:s,disabled:n,allowDataInference:d,getData:h}){return e.jsx(g.Formik,{initialValues:{enumValues:a},validateOnMount:!0,onSubmit:(f,u)=>{},children:({values:f,errors:u})=>(C.useEffect(()=>{l&&l(f.enumValues)},[f.enumValues]),C.useEffect(()=>{o&&o(!!(u?.enumValues??!1))},[u]),e.jsx(yr,{enumValuesPath:"enumValues",values:f,errors:u,shouldUpdateId:s,disabled:n,allowDataInference:d,getData:h}))})},function(a,l){return a.enumValues.length===l.enumValues.length&&a.onValuesChanged===l.onValuesChanged&&a.getData===l.getData});function yr({values:r,errors:a,disabled:l,enumValuesPath:o,shouldUpdateId:s,allowDataInference:n,getData:d}){const{setFieldValue:h}=g.useFormikContext(),[f,u]=C.useState(),[c,p]=C.useState(),[T,m]=C.useState(!1),N=C.useRef(new Set).current,F=(y,P)=>{const x=f===P;return e.jsx(vr,{index:y,disabled:l,enumValuesPath:o,autoFocus:x,shouldUpdateId:s||x,onDialogOpen:()=>p(y),inferredEntry:N.has(r.enumValues[y]?.id)},`${P}`)},w=async()=>{d&&(m(!0),d?.().then(y=>{if(!y)return;const P=y.flat(),x=Array.from(new Set(P)),v=r.enumValues,U=De.extractEnumFromValues(x).filter(D=>!v?.some(V=>V.id===D.id));U.forEach(D=>{N.add(D.id)}),h(o,[...U,...v])}).catch(y=>{console.error(y)}).finally(()=>m(!1)))};return e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"ml-3.5 flex flex-row items-center",children:[e.jsx(t.ListIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2 grow",children:"Values"}),n&&e.jsxs(t.Button,{loading:T,disabled:l||T,variant:"text",size:"small",onClick:w,children:[T?e.jsx(t.CircularProgress,{size:"small"}):e.jsx(t.AutoAwesomeIcon,{}),"Infer values from data"]})]}),e.jsxs(t.Paper,{className:"p-4 m-1",children:[e.jsx(i.FormikArrayContainer,{value:r.enumValues,addLabel:"Add enum value",name:o,buildEntry:F,disabled:l,onInternalIdAdded:u,small:!0,setFieldValue:h,includeAddButton:!0}),e.jsx(mr,{index:c,open:c!==void 0,enumValuesPath:o,onClose:()=>p(void 0)})]})]})}const vr=C.memo(function({index:a,shouldUpdateId:l,enumValuesPath:o,autoFocus:s,onDialogOpen:n,disabled:d,inferredEntry:h}){const{values:f,handleChange:u,errors:c,setFieldValue:p,touched:T}=g.useFormikContext(),m=C.useRef(!g.getIn(f,`${o}[${a}].id`)),b=l||m.current,N=g.getIn(f,`${o}[${a}].id`),F=g.getIn(f,`${o}[${a}].label`),w=g.getIn(c,`${o}[${a}].label`),y=C.useRef(F);return C.useEffect(()=>{(y.current===N||!N)&&b&&p(`${o}[${a}].id`,F),y.current=F},[F]),e.jsxs("div",{className:"flex w-full align-center justify-center",children:[e.jsx(g.FastField,{name:`${o}[${a}].label`,as:t.DebouncedTextField,className:"flex-grow",required:!0,disabled:d,size:"small",validate:br,autoFocus:s,autoComplete:"off",endAdornment:h&&e.jsx(t.AutoAwesomeIcon,{size:"small"}),error:!!w}),!d&&e.jsx(t.IconButton,{size:"small","aria-label":"edit",className:"m-1",onClick:()=>n(),children:e.jsx(t.SettingsIcon,{size:"small"})})]})},function(a,l){return a.index===l.index&&a.enumValuesPath===l.enumValuesPath&&a.shouldUpdateId===l.shouldUpdateId&&a.inferredEntry===l.inferredEntry&&a.autoFocus===l.autoFocus});function mr({index:r,open:a,onClose:l,enumValuesPath:o}){const{values:s,handleChange:n,errors:d,setFieldValue:h,touched:f}=g.useFormikContext(),u=r!==void 0?g.getIn(d,`${o}[${r}].id`):void 0;return e.jsxs(t.Dialog,{maxWidth:"md","aria-labelledby":"enum-edit-dialog",open:a,onOpenChange:c=>c?void 0:l(),children:[e.jsx(t.DialogContent,{children:r!==void 0&&e.jsxs("div",{children:[e.jsx(g.FastField,{name:`${o}[${r}]id`,as:t.DebouncedTextField,required:!0,validate:Cr,label:"ID",size:"small",autoComplete:"off",error:!!u}),e.jsx(H,{error:!!u,children:u??"Value saved in the data source"})]})}),e.jsx(t.DialogActions,{children:e.jsx(t.Button,{autoFocus:!0,variant:"outlined",onClick:l,color:"primary",children:"Ok"})})]})}function br(r){let a;return r||(a="You must specify a label"),a}function Cr(r){let a;return r||(a="You must specify an ID"),a}function fe({disabled:r}){const{values:a,handleChange:l}=g.useFormikContext(),o="validation.required",s="validation.requiredMessage",n="validation.unique";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-6",children:e.jsx(g.FastField,{type:"checkbox",disabled:r,name:o,label:"Required",tooltip:"You won't be able to save this entity if this value is not set",component:i.SwitchControl})}),e.jsx("div",{className:"col-span-6",children:e.jsx(g.FastField,{type:"checkbox",disabled:r,name:n,label:"Unique",tooltip:"There cannot be multiple entities with the same value",component:i.SwitchControl})}),g.getIn(a,o)&&e.jsx("div",{className:"col-span-12",children:e.jsx(t.DebouncedTextField,{disabled:r,value:g.getIn(a,s),label:"Required message",name:s,size:"small",onChange:l})})]})}function be({length:r,lowercase:a,matches:l,max:o,min:s,trim:n,uppercase:d,disabled:h,showErrors:f}){const{values:u,handleChange:c,errors:p}=g.useFormikContext(),T="validation.length",m="validation.min",b="validation.max",N="validation.trim",F="validation.matches",w="validation.lowercase",y="validation.uppercase",P=g.getIn(p,F),x=g.getIn(u,F),v=typeof x=="string"?x:i.serializeRegExp(x);return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(fe,{disabled:h}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 col-span-12",children:[a&&e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:w,label:"Lowercase",disabled:h,component:i.SwitchControl})}),d&&e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:y,label:"Uppercase",disabled:h,component:i.SwitchControl})}),n&&e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:N,label:"Trim",disabled:h,component:i.SwitchControl})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-2 col-span-12",children:[r&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:g.getIn(u,T),label:"Exact length",name:T,type:"number",size:"small",disabled:h,onChange:c})}),s&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:g.getIn(u,m),label:"Min length",name:m,type:"number",size:"small",disabled:h,onChange:c})}),o&&e.jsx("div",{className:"col-span-4",children:e.jsx(t.DebouncedTextField,{value:g.getIn(u,b),label:"Max length",name:b,type:"number",size:"small",disabled:h,onChange:c})})]}),l&&e.jsxs("div",{className:"col-span-12",children:[e.jsx(g.FastField,{name:F,as:t.DebouncedTextField,validate:E=>E&&!i.isValidRegExp(E),label:"Matches regex",size:"small",disabled:h,value:v,error:!!P}),e.jsx(H,{error:!!P,children:P?"Not a valid regexp":"e.g. /^\\d+$/ for digits only"})]})]})}function ke({max:r=!0,min:a=!0,disabled:l}){const{values:o,handleChange:s}=g.useFormikContext(),n="validation.min",d="validation.max";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(fe,{disabled:l}),a&&e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(o,n),disabled:l,label:"Min length",name:n,type:"number",size:"small",onChange:s})}),r&&e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(o,d),disabled:l,label:"Max length",name:d,type:"number",size:"small",onChange:s})})]})}function ie({children:r}){return e.jsx(t.ExpandablePanel,{initiallyExpanded:!1,asField:!0,className:"p-4",title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.RuleIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"Validation"})]}),children:r})}function Le({multiselect:r,updateIds:a,disabled:l,showErrors:o,allowDataInference:s,getData:n}){const{values:d,handleChange:h,errors:f,touched:u,setFieldError:c,setFieldValue:p}=g.useFormikContext(),T=i.useSnackbarController(),m=r?"of.enumValues":"enumValues",b=g.getIn(d,"defaultValue"),N=g.getIn(d,m),F=C.useMemo(()=>!N||typeof N=="boolean"?[]:i.resolveEnumValues(N)??[],[N]),w=y=>{if(d&&(p(m,y),!r)){const P=y.filter(x=>!!x?.id).map(x=>x.id);b&&!P.includes(b)&&(p("defaultValue",void 0),T.open({type:"warning",message:"Default value was cleared"}))}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(ur,{enumValues:F,updateIds:a,disabled:l,allowDataInference:s,onError:y=>{c(m,y?"":void 0)},getData:n?()=>n().then(y=>y.map(P=>d.id&&g.getIn(P,d.id)).filter(Boolean)):void 0,onValuesChanged:w})}),e.jsx("div",{className:"col-span-12",children:e.jsxs(ie,{children:[!r&&e.jsx(be,{disabled:l,showErrors:o}),r&&e.jsx(ke,{disabled:l})]})}),!r&&e.jsx("div",{className:"col-span-12",children:e.jsx(t.Select,{disabled:l,position:"item-aligned",onValueChange:y=>{p("defaultValue",y)},label:"Default value",value:b??"",children:F.filter(y=>!!y?.id).map(y=>e.jsx(t.SelectItem,{value:y.id?.toString(),children:y.label},y.id))})})]})}const Ne={"image/*":"Images","video/*":"Videos","audio/*":"Audio files","application/*":"Files (pdf, zip, csv, excel...)","text/*":"Text files"};function $e({multiple:r,existing:a,disabled:l}){const{values:o,setFieldValue:s}=g.useFormikContext(),n=r?"of.storage":"storage",d=`${n}.acceptedFiles`,h=`${n}.fileName`,f=`${n}.storagePath`,u=`${n}.storeUrl`,c=g.getIn(o,h)??"{rand}_{file}",p=g.getIn(o,f)??"/",T=g.getIn(o,d),m=Array.isArray(T)?T:void 0,b=!m||m.length===0,N=y=>{y?y.includes("all")||y.length>=Object.keys(Ne).length?s(d,void 0):b?s(d,Object.keys(Ne).filter(P=>!y.includes(P))):s(d,y):s(d,void 0)},F=typeof c=="function",w=typeof p=="function";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(t.ExpandablePanel,{title:e.jsxs("div",{className:"flex flex-row text-gray-500",children:[e.jsx(t.FileUploadIcon,{}),e.jsx(t.Typography,{variant:"subtitle2",className:"ml-2",children:"File upload config"})]}),children:e.jsxs("div",{className:"grid grid-cols-12 gap-2 p-4",children:[e.jsx("div",{className:"col-span-12",children:e.jsxs(t.MultiSelect,{disabled:l,name:d,value:m??[],onMultiValueChange:N,label:b?void 0:"Allowed file types",renderValues:y=>!y||y.length===0?"All file types allowed":y.map(P=>Ne[P]).filter(P=>!!P).join(", "),children:[e.jsxs(t.MultiSelectItem,{value:"all",className:"flex items-center gap-2",children:[e.jsx(t.Checkbox,{checked:!m}),"All"]},"all"),Object.entries(Ne).map(([y,P])=>e.jsxs(t.MultiSelectItem,{value:y,className:"flex items-center gap-2",children:[e.jsx(t.Checkbox,{checked:b||m.indexOf(y)>-1}),e.jsx("div",{className:"flex-grow",children:P}),e.jsx(t.Button,{size:"small",variant:"outlined",onClick:x=>(x.preventDefault(),x.stopPropagation(),s(d,[y])),children:"Only"})]},y))]})}),e.jsx("div",{className:"col-span-12",children:e.jsx(g.Field,{name:h,as:t.DebouncedTextField,label:"File name",size:"small",disabled:F||l,value:F?"-":c})}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(g.Field,{name:f,as:t.DebouncedTextField,label:"Storage path",disabled:w||l,size:"small",value:w?"-":p}),e.jsxs(t.Typography,{variant:"caption",className:"ml-3.5 mt-1 mb-2",children:[e.jsx("p",{children:"You can use the following placeholders in the file name and storage path values:"}),e.jsxs("ul",{children:[e.jsx("li",{children:"{file} - Full name of the uploaded file"}),e.jsx("li",{children:"{file.name} - Name of the uploaded file without extension"}),e.jsx("li",{children:"{file.ext} - Extension of the uploaded file"}),e.jsx("li",{children:"{entityId} - ID of the entity"}),e.jsx("li",{children:"{propertyKey} - ID of this field"}),e.jsx("li",{children:"{path} - Path of this entity"}),e.jsx("li",{children:"{rand} - Random value used to avoid name collisions"})]})]}),e.jsx(g.Field,{type:"checkbox",name:u,label:"Save URL instead of storage path",disabled:a||l,component:i.SwitchControl}),e.jsx("br",{}),e.jsx(t.Typography,{variant:"caption",className:"ml-3.5 mt-1 mb-2",children:"Turn this setting on, if you prefer to save the download URL of the uploaded file instead of the storage path. You can only change this prop upon creation."})]})]})})}),e.jsx("div",{className:"col-span-12",children:e.jsxs(ie,{children:[!r&&e.jsx("div",{className:"grid grid-cols-12 gap-2",children:e.jsx(fe,{disabled:l})}),r&&e.jsx("div",{className:"col-span-12",children:e.jsx(ke,{disabled:l})})]})})]})}function Ce(r){if(i.isPropertyBuilder(r)||i.isPropertyBuilder(r))return!1;{const a=r;return a.dataType==="array"&&typeof a.of=="function"||a.dataType==="array"&&Array.isArray(a.of)?!1:!!a.editable}}function je(r){return Object.entries(r).filter(([a,l])=>Ce(l)).map(([a,l])=>{const o=l;if(Ce(o))return o.dataType==="map"&&o.properties?{[a]:{...o,properties:je(o.properties)}}:{[a]:o}}).filter(a=>!!a).reduce((a,l)=>({...a,...l}),{})}function Ye({property:r,onClick:a,hasError:l,includeName:o,includeEditButton:s,selected:n}){const{propertyConfigs:d}=i.useCustomizationController(),h=i.getFieldConfig(r,d);Ce(r);const f=l?"border-red-500":n?"border-primary":"border-transparent";return e.jsx(i.ErrorBoundary,{children:e.jsxs("div",{onClick:a,className:"flex flex-row w-full cursor-pointer",children:[e.jsx("div",{className:"m-4",children:e.jsx(i.PropertyConfigBadge,{propertyConfig:h})}),e.jsxs(t.Paper,{className:t.cn("pl-2 w-full flex flex-row gap-4 items-center",t.cardMixin,a?t.cardClickableMixin:"",n?t.cardSelectedMixin:"","flex-grow p-4 border transition-colors duration-200",f),children:[e.jsxs("div",{className:"w-full flex flex-col",children:[o&&e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body1",component:"span",className:"flex-grow pr-2",children:r.name?r.name:" "})}),e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{className:"flex-grow pr-2",variant:o?"body2":"subtitle1",component:"span",color:"secondary",children:h?.name})}),e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:r.dataType})})]})]}),s&&e.jsx(t.Typography,{variant:"button",children:"EDIT"})]})]})})}function Tr({name:r,selected:a,onClick:l,property:o}){const{propertyConfigs:s}=i.useCustomizationController(),n=!i.isPropertyBuilder(o)&&o?i.getFieldConfig(o,s):void 0;return e.jsxs("div",{onClick:l,className:"flex flex-row w-full cursor-pointer",children:[e.jsxs("div",{className:"relative m-4",children:[n&&e.jsx(i.PropertyConfigBadge,{propertyConfig:n}),!n&&e.jsx("div",{className:"h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500",children:e.jsx(t.FunctionsIcon,{color:"inherit",size:"medium"})}),e.jsx(t.RemoveCircleIcon,{color:"disabled",size:"small",className:"absolute -right-2 -top-2"})]}),e.jsx(t.Paper,{className:t.cn("pl-2 w-full flex flex-row gap-4 items-center",t.cardMixin,l?t.cardClickableMixin:"",a?t.cardSelectedMixin:"","flex-grow p-4 border transition-colors duration-200",a?"border-primary":"border-transparent"),children:e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsx(t.Typography,{variant:"body1",component:"span",className:"flex-grow pr-2",children:o?.name?o.name:r}),e.jsxs("div",{className:"flex flex-row items-center",children:[n&&e.jsx(t.Typography,{className:"flex-grow pr-2",variant:"body2",component:"span",color:"secondary",children:n?.name}),o&&!i.isPropertyBuilder(o)&&e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:o.dataType})}),o&&i.isPropertyBuilder(o)&&e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:"This property is defined as a property builder in code"})}),!o&&e.jsx(i.ErrorBoundary,{children:e.jsx(t.Typography,{variant:"body2",component:"span",color:"disabled",children:"This field is defined as an additional field in code"})})]})]})})]})}function we({namespace:r,selectedPropertyKey:a,onPropertyClick:l,properties:o,propertiesOrder:s,additionalFields:n,errors:d,onPropertyMove:h,onPropertyRemove:f,className:u,inferredPropertyKeys:c,collectionEditable:p}){const T=s??Object.keys(o),m=C.useCallback(b=>{if(!b.destination)return;const N=b.source.index,F=b.destination.index,w=Array.from(T),[y]=w.splice(N,1);w.splice(F,0,y),h&&h(w,r)},[r,h,T]);return e.jsx(e.Fragment,{children:e.jsx(_e.DragDropContext,{onDragEnd:m,children:e.jsx(_e.Droppable,{droppableId:`droppable_${r}`,children:(b,N)=>e.jsxs("div",{...b.droppableProps,ref:b.innerRef,className:u,children:[T&&T.map((F,w)=>{const y=o[F],P=n?.find(x=>x.key===F);return!y&&!P?(console.warn(`Property ${F} not found in properties or additionalFields`),null):e.jsx(_e.Draggable,{draggableId:`array_field_${r}_${F}}`,index:w,children:(x,v)=>e.jsx(i.ErrorBoundary,{children:e.jsx(Pr,{propertyKey:F,propertyOrBuilder:y,additionalField:P,provided:x,errors:d,namespace:r,inferredPropertyKeys:c,onPropertyMove:h,onPropertyRemove:f,onPropertyClick:v.isDragging?void 0:l,selectedPropertyKey:a,collectionEditable:p})})},`array_field_${r}_${F}}`)}).filter(Boolean),b.placeholder]})})})})}function Pr({propertyKey:r,namespace:a,propertyOrBuilder:l,additionalField:o,provided:s,selectedPropertyKey:n,errors:d,onPropertyClick:h,onPropertyMove:f,onPropertyRemove:u,inferredPropertyKeys:c,collectionEditable:p}){const T=c?.includes(a?`${a}.${r}`:r),m=K(r,a);let b;if(typeof l=="object"){const y=l;y.dataType==="map"&&y.properties&&(b=e.jsx(we,{selectedPropertyKey:n,namespace:m,properties:y.properties,propertiesOrder:y.propertiesOrder,errors:d,onPropertyClick:h,onPropertyMove:f,onPropertyRemove:u,collectionEditable:p}))}const N=m?g.getIn(d,te(m)):!1,F=n===m,w=l&&(p&&!i.isPropertyBuilder(l)||Ce(l));return e.jsxs("div",{ref:s.innerRef,...s.draggableProps,...s.dragHandleProps,className:"relative -ml-8",children:[b&&e.jsx("div",{className:"absolute border-l "+t.defaultBorderMixin,style:{left:"32px",top:"64px",bottom:"16px"}}),!i.isPropertyBuilder(l)&&!o&&w?e.jsx(Ye,{property:l,onClick:h?()=>h(r,a):void 0,includeName:!0,selected:F,hasError:N}):e.jsx(Tr,{name:r,property:l,onClick:h?()=>h(r,a):void 0,selected:F}),e.jsxs("div",{className:"absolute top-2 right-2 flex flex-row ",children:[T&&e.jsx(t.Tooltip,{title:"Inferred property",children:e.jsx(t.AutoAwesomeIcon,{size:"small",className:"p-2"})}),u&&e.jsx(t.Tooltip,{title:"Remove",children:e.jsx(t.IconButton,{size:"small",color:"inherit",onClick:()=>u(r,a),children:e.jsx(t.RemoveIcon,{size:"small"})})}),f&&e.jsx(t.Tooltip,{title:"Move",children:e.jsx(t.IconButton,{component:"span",size:"small",children:e.jsx(t.DragHandleIcon,{size:"small"})})})]}),b&&e.jsx("div",{className:"ml-16",children:b})]})}function xr({disabled:r,getData:a,allowDataInference:l,propertyConfigs:o,collectionEditable:s}){const{values:n,setFieldValue:d}=g.useFormikContext(),[h,f]=C.useState(!1),[u,c]=C.useState(),[p,T]=C.useState(),m=n.propertiesOrder??Object.keys(n.properties??{}),b=C.useCallback(({id:v,property:E})=>{if(!v)throw Error();d("properties",{...n.properties??{},[v]:E},!1),d("propertiesOrder",[...m,v],!1),f(!1)},[n.properties,m]),N=C.useCallback((v,E)=>{const U=v?K(v,E):void 0;if(!U)throw Error("collection editor miss config");const D=te(U),V=oe(E),L=g.getIn(n,V)??Object.keys(g.getIn(n,qe(E)));d(D,void 0,!1),d(V,L.filter(O=>O!==v),!1),f(!1),c(void 0),T(void 0)},[d,n]),F=u?K(u,p):void 0,w=F?g.getIn(n.properties,F.replaceAll(".",".properties.")):void 0,y=e.jsxs(t.Button,{color:"primary",variant:"outlined",onClick:()=>f(!0),startIcon:e.jsx(t.AddIcon,{}),children:["Add property to ",n.name??"this group"]}),P=!m||m.length<1,x=C.useCallback((v,E)=>{d(oe(E),v,!1)},[]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"flex justify-between items-end my-4",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Properties in this group"}),y]}),e.jsxs(t.Paper,{className:"p-2 pl-8",children:[e.jsx(we,{properties:n.properties??{},propertiesOrder:m,errors:{},collectionEditable:s,onPropertyClick:(v,E)=>{c(v),T(E),f(!0)},onPropertyMove:x}),P&&e.jsx(t.Typography,{variant:"label",className:"h-full flex items-center justify-center p-4",children:"Add the first property to this group"})]})]}),e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.BooleanSwitchWithLabel,{position:"start",size:"small",label:"Spread children as columns",onValueChange:v=>d("spreadChildren",v),value:n.spreadChildren??!1}),e.jsx(H,{children:"Set this flag to true if you want to display the children of this group as individual columns."})]}),e.jsx(ge,{inArray:!1,forceShowErrors:!1,open:h,allowDataInference:l,collectionEditable:s,onCancel:()=>{f(!1),c(void 0),T(void 0)},onOkClicked:()=>{f(!1),c(void 0),T(void 0)},getData:a,onDelete:N,propertyKey:u,propertyNamespace:p,property:w,existingProperty:!!u,autoUpdateId:!u,autoOpenTypeSelect:!u,onPropertyChanged:b,existingPropertyKeys:u?void 0:m,propertyConfigs:o})]})}function Fr({showErrors:r,existing:a,disabled:l,getData:o,allowDataInference:s,propertyConfigs:n,collectionEditable:d}){const{values:h,handleChange:f,errors:u,setFieldValue:c,touched:p}=g.useFormikContext(),[T,m]=C.useState(!1),b=g.getIn(h,"of"),N=g.getIn(p,"of")&&g.getIn(u,"of"),F=C.useCallback(({id:y,property:P,namespace:x})=>{c("of",P)},[]),w=b&&i.getFieldConfig(b,n);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Repeat component"}),e.jsx(g.Field,{name:"of",value:b,validate:y=>y?.dataType?void 0:"You need to specify a repeat field",children:()=>e.jsxs(t.Paper,{className:"p-2 mt-4",children:[b&&e.jsx(Ye,{property:b,onClick:l?void 0:()=>m(!0),includeName:!1,includeEditButton:!0,selected:!1,hasError:!1}),!l&&!b&&e.jsxs(t.Button,{variant:"text",size:"large",color:N?"error":"primary",onClick:()=>m(!0),children:["Edit ",`${w?w.name:"repeat component"}`]}),e.jsx(ge,{inArray:!0,open:T,existingProperty:a,getData:o,autoUpdateId:!a,autoOpenTypeSelect:!a,onOkClicked:()=>m(!1),allowDataInference:s,property:b,includeIdAndName:!1,onPropertyChanged:F,forceShowErrors:r,propertyConfigs:n,collectionEditable:d})]})})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(ke,{disabled:l})})})]})}const Nr=C.forwardRef(function({showErrors:a,disabledId:l,existingPropertyKeys:o,disabled:s,autoUpdateId:n,isNewProperty:d},h){const{errors:f,values:u,setFieldValue:c,setFieldTouched:p,touched:T}=g.useFormikContext(),m="name",b=a&&g.getIn(f,m),N="id",F=a&&g.getIn(f,N),w="description",y=a&&g.getIn(f,w);return e.jsxs("div",{className:"flex flex-col gap-2 col-span-12",children:[e.jsxs("div",{children:[e.jsx(g.Field,{inputRef:h,as:t.DebouncedTextField,value:u[m],onChange:P=>{const x=P.target.value;c(m,x),p(m,!0,!0),!g.getIn(T,N)&&n&&c(N,x?i.toSnakeCase(x):"")},style:{fontSize:20},validate:Sr,placeholder:"Field name",required:!0,disabled:s,error:!!b}),e.jsx(H,{error:!!b,children:b})]}),e.jsxs("div",{children:[e.jsx(g.Field,{as:t.DebouncedTextField,label:"ID",value:u[N],onChange:P=>{const x=P.target.value;c(N,x),p(N,!0,!0),!g.getIn(T,m)&&n&&c(m,x?i.unslugify(x):"")},validate:()=>Ir(u[N],o),disabled:l||s,required:!0,size:"small",error:!!F}),e.jsx(H,{error:!!F,children:F})]}),e.jsxs("div",{children:[e.jsx(g.Field,{name:w,as:t.DebouncedTextField,label:"Description",disabled:s,error:!!y}),e.jsx(H,{error:!!y,children:y})]})]})}),wr=/^[a-zA-Z_][a-zA-Z0-9_]*$/;function Ir(r,a){let l;return r||(l="You must specify an id for the field"),r&&!r.match(wr)&&(l="The id can only contain letters, numbers and underscores (_), and not start with a number"),r&&a&&a.includes(r)&&(l="There is another field with this ID already"),l}function Sr(r){let a;return r||(a="You must specify a title for the field"),a}function Or({widgetId:r,disabled:a,showErrors:l}){const{values:o,setFieldValue:s}=g.useFormikContext();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsxs(ie,{children:[r==="text_field"&&e.jsx(be,{disabled:a,length:!0,lowercase:!0,matches:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:l}),r==="multiline"&&e.jsx(be,{disabled:a,length:!0,lowercase:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:l}),r==="markdown"&&e.jsx(be,{disabled:a,length:!0,lowercase:!0,max:!0,min:!0,trim:!0,uppercase:!0,showErrors:l}),r==="email"&&e.jsx(be,{disabled:a,max:!0,min:!0,trim:!0,showErrors:l})]})}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.TextField,{name:"defaultValue",disabled:a,onChange:n=>{s("defaultValue",n.target.value===""?void 0:n.target.value)},label:"Default value",value:g.getIn(o,"defaultValue")??""})})]})}function Vr({disabled:r}){const{values:a}=g.useFormikContext(),l=g.getIn(a,"defaultValue");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(fe,{disabled:r})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(g.FastField,{type:"checkbox",name:"defaultValue",label:l==null?"Default value not set":"Default value is "+l.toString(),disabled:r,allowIndeterminate:!0,component:i.SwitchControl})})]})}function Er({disabled:r,getData:a,allowDataInference:l,propertyConfigs:o,collectionEditable:s}){const{values:n,setFieldValue:d}=g.useFormikContext(),[h,f]=C.useState(!1),[u,c]=C.useState(),[p,T]=C.useState(),m=C.useCallback(({id:P,property:x})=>{if(!P)throw Error();d("oneOf.properties",{...n.oneOf?.properties??{},[P]:x},!1),d("oneOf.propertiesOrder",[...n.oneOf?.propertiesOrder??Object.keys(n.oneOf?.properties??{}),P],!1),f(!1)},[n.oneOf?.properties,n.oneOf?.propertiesOrder]),b=u?K(u,p):void 0,N=b?g.getIn(n.oneOf?.properties,b.replaceAll(".",".properties.")):void 0,F=C.useCallback((P,x)=>{const v=P?K(P,x):void 0;if(!v)throw Error("collection editor miss config");d(`oneOf.${te(v)}`,void 0,!1);const E=`oneOf.${oe(x)}`,U=g.getIn(n,E);d(E,U.filter(D=>D!==P),!1),f(!1),c(void 0),T(void 0)},[d,n]),w=e.jsxs(t.Button,{autoFocus:!0,color:"primary",onClick:()=>f(!0),startIcon:e.jsx(t.AddIcon,{}),children:["Add property to ",n.name??"this block"]}),y=C.useCallback((P,x)=>{d(`oneOf.${oe(x)}`,P,!1)},[]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"col-span-12",children:[e.jsxs("div",{className:"flex justify-between items-end mt-8 mb-4",children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Properties in this block"}),w]}),e.jsxs(t.Paper,{className:"p-2 pl-8",children:[e.jsx(we,{properties:n.oneOf?.properties??{},propertiesOrder:n.oneOf?.propertiesOrder,errors:{},collectionEditable:s,onPropertyClick:r?void 0:(P,x)=>{c(P),T(x),f(!0)},onPropertyMove:r?void 0:y}),!r&&!n.oneOf?.propertiesOrder?.length&&e.jsx("div",{className:"h-full flex items-center justify-center p-4",children:"Add the first property to this block"})]})]}),!r&&e.jsx(ge,{inArray:!1,forceShowErrors:!1,open:h,getData:a,allowDataInference:l,onCancel:()=>{f(!1),c(void 0),T(void 0)},onOkClicked:()=>{f(!1),c(void 0),T(void 0)},collectionEditable:s,onDelete:F,propertyKey:u,propertyNamespace:p,property:N,existingProperty:!!u,autoUpdateId:!u,autoOpenTypeSelect:!u,onPropertyChanged:m,existingPropertyKeys:u?void 0:n.oneOf?.propertiesOrder,propertyConfigs:o})]})}function Br({disabled:r}){const{values:a,handleChange:l}=g.useFormikContext(),o="validation.min",s="validation.max",n="validation.lessThan",d="validation.moreThan",h="validation.positive",f="validation.negative",u="validation.integer";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx(fe,{disabled:r}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(a,o),label:"Min value",name:o,type:"number",size:"small",disabled:r,onChange:l})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(a,s),label:"Max value",name:s,type:"number",size:"small",disabled:r,onChange:l})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(a,n),label:"Less than",name:n,type:"number",size:"small",disabled:r,onChange:l})}),e.jsx("div",{className:"col-span-6",children:e.jsx(t.DebouncedTextField,{value:g.getIn(a,d),label:"More than",name:d,type:"number",size:"small",disabled:r,onChange:l})}),e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:h,label:"Positive value",disabled:r,component:i.SwitchControl})}),e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:f,label:"Negative value",disabled:r,component:i.SwitchControl})}),e.jsx("div",{className:"col-span-4",children:e.jsx(g.FastField,{type:"checkbox",name:u,label:"Integer value",disabled:r,component:i.SwitchControl})})]})}function Dr({disabled:r}){const{values:a,setFieldValue:l}=g.useFormikContext();return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(Br,{disabled:r})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.TextField,{name:"defaultValue",disabled:r,type:"number",onChange:o=>{l("defaultValue",o.target.value===""?void 0:parseFloat(o.target.value))},label:"Default value",value:g.getIn(a,"defaultValue")??""})})]})}function Ge({existing:r,multiple:a,disabled:l,showErrors:o}){const{values:s,handleChange:n,errors:d}=g.useFormikContext();if(!i.useNavigationController())return e.jsx("div",{className:"col-span-12",children:e.jsx(t.CircularProgress,{})});const f=a?"of.path":"path",u=g.getIn(s,f),c=o&&g.getIn(d,f);return e.jsx(e.Fragment,{children:e.jsx("div",{className:"col-span-12",children:e.jsx(g.Field,{required:!0,name:f,pathPath:f,type:"select",validate:_r,disabled:r||l,value:u,error:c,handleChange:n,component:kr})})})}function _r(r){let a;return r||(a="You must specify a target collection for the field"),a}function kr({disabled:r,pathPath:a,value:l,handleChange:o,error:s,...n}){const d=i.useNavigationController();if(!d)return e.jsx("div",{className:"col-span-12",children:e.jsx(t.CircularProgress,{})});const h=d?.collections??[],f=Array.from(new Set(Object.values(h).map(c=>c.group).filter(Boolean)).values()),u=h.filter(c=>!c.group);return e.jsxs(e.Fragment,{children:[e.jsxs(t.Select,{error:!!s,disabled:r,value:l??"",position:"item-aligned",name:a,onChange:o,label:"Target collection",renderValue:c=>{const p=h.find(T=>T.id===c||T.path===c);return p?e.jsxs("div",{className:"flex flex-row",children:[e.jsx(i.IconForView,{collectionOrView:p}),e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:p?.name.toUpperCase()})]}):null},...n,children:[f.flatMap(c=>e.jsx(t.SelectGroup,{label:c||"Views",children:h.filter(p=>p.group===c).map(p=>e.jsx(t.SelectItem,{value:p.id??p.path,children:e.jsxs("div",{className:"flex flex-row",children:[e.jsx(i.IconForView,{collectionOrView:p}),e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:p?.name.toUpperCase()})]})},`${p.id??p.path}-${c}`))},`group_${c}`)),u&&e.jsx(t.SelectGroup,{label:"Views",children:u.map(c=>e.jsx(t.SelectItem,{value:c.id??c.path,children:e.jsxs("div",{className:"flex flex-row",children:[e.jsx(i.IconForView,{collectionOrView:c}),e.jsx(t.Typography,{variant:"subtitle2",className:"font-medium ml-4",children:c?.name.toUpperCase()})]})},c.id??c.path))})]}),e.jsx(H,{children:"You can only edit the reference collection upon field creation."})]})}function Ar({disabled:r}){const{values:a,errors:l,touched:o,setFieldValue:s}=g.useFormikContext(),n="mode",d=g.getIn(a,n),h=g.getIn(o,n)&&g.getIn(l,n),f="autoValue",u=g.getIn(a,f),c=g.getIn(o,f)&&g.getIn(l,f);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col col-span-12",children:[e.jsxs(t.Select,{name:n,value:d??"date",error:!!h,onValueChange:p=>s(n,p),label:"Mode",renderValue:p=>{switch(p){case"date_time":return"Date/Time";case"date":return"Date";default:return""}},disabled:r,children:[e.jsx(t.SelectItem,{value:"date_time",children:" Date/Time "}),e.jsx(t.SelectItem,{value:"date",children:" Date "})]}),e.jsx(H,{error:!!h,children:h}),e.jsxs(t.Select,{name:f,disabled:r,value:u??"",onValueChange:p=>s(f,p),renderValue:p=>{switch(p){case"on_create":return"On create";case"on_update":return"On any update";default:return"None"}},error:!!c,label:"Automatic value",children:[e.jsx(t.SelectItem,{value:"",children:" None "}),e.jsx(t.SelectItem,{value:"on_create",children:" On create "}),e.jsx(t.SelectItem,{value:"on_update",children:" On any update "})]}),e.jsx(H,{error:!!c,children:c??"Update this field automatically when creating or updating the entity"})]}),e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(fe,{disabled:r})})})]})}function Mr({disabled:r}){g.useFormikContext();const a="hideFromCollection",l="readOnly";return e.jsxs("div",{className:"grid grid-cols-12 gap-2",children:[e.jsx("div",{className:"col-span-12",children:e.jsx(g.FastField,{type:"checkbox",name:a,label:"Hide from collection",disabled:r,tooltip:"Hide this field from the collection view. It will still be visible in the form view",component:i.SwitchControl})}),e.jsx("div",{className:"col-span-12",children:e.jsx(g.FastField,{type:"checkbox",name:l,label:"Read only",disabled:r,tooltip:"Is this a read only field. Display only as a preview",component:i.SwitchControl})})]})}function zr({disabled:r}){return e.jsx(e.Fragment,{children:e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(fe,{disabled:r})})})})}function He(r,a,l){let o;return a==="text_field"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"text_field",editable:r.editable!==void 0?r.editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:void 0}):a==="multiline"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"multiline",editable:r.editable!==void 0?r.editable:!0,multiline:!0,storage:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:void 0}):a==="markdown"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"markdown",editable:r.editable!==void 0?r.editable:!0,storage:void 0,multiline:void 0,markdown:!0,email:void 0,url:void 0}):a==="url"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"url",editable:r.editable!==void 0?r.editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:!0,enumValues:void 0}):a==="email"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"email",editable:r.editable!==void 0?r.editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:!0,url:void 0,enumValues:void 0}):a==="select"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"select",editable:r.editable!==void 0?r.editable:!0,storage:void 0,multiline:void 0,markdown:void 0,email:void 0,url:void 0,enumValues:r.enumValues??[]}):a==="multi_select"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"multi_select",editable:r.editable!==void 0?r.editable:!0,of:{dataType:"string",enumValues:r.of?.enumValues??[]}}):a==="number_input"?o=i.mergeDeep(r,{dataType:"number",propertyConfig:"number_input",editable:r.editable!==void 0?r.editable:!0,enumValues:void 0}):a==="number_select"?o=i.mergeDeep(r,{dataType:"number",propertyConfig:"number_select",editable:r.editable!==void 0?r.editable:!0,enumValues:r.enumValues??[]}):a==="multi_number_select"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"multi_number_select",editable:r.editable!==void 0?r.editable:!0,of:{dataType:"number",enumValues:r.of?.enumValues??[]}}):a==="file_upload"?o=i.mergeDeep(r,{dataType:"string",propertyConfig:"file_upload",editable:r.editable!==void 0?r.editable:!0,storage:{storagePath:"/"}}):a==="multi_file_upload"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"multi_file_upload",editable:r.editable!==void 0?r.editable:!0,of:{dataType:"string",storage:r.of?.storage??{storagePath:"/"}}}):a==="group"?o=i.mergeDeep(r,{dataType:"map",propertyConfig:"group",editable:r.editable!==void 0?r.editable:!0,keyValue:!1,properties:r.properties??{}}):a==="key_value"?o=i.mergeDeep(r,{dataType:"map",propertyConfig:"key_value",editable:r.editable!==void 0?r.editable:!0,keyValue:!0,properties:void 0}):a==="reference"?o=i.mergeDeep(r,{dataType:"reference",propertyConfig:"reference",editable:r.editable!==void 0?r.editable:!0}):a==="multi_references"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"multi_references",editable:r.editable!==void 0?r.editable:!0,of:{dataType:"reference"}}):a==="switch"?o=i.mergeDeep(r,{dataType:"boolean",propertyConfig:"switch",editable:r.editable!==void 0?r.editable:!0}):a==="date_time"?o=i.mergeDeep(r,{dataType:"date",propertyConfig:"date_time",editable:r.editable!==void 0?r.editable:!0,mode:"date_time"}):a==="repeat"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"repeat",editable:r.editable!==void 0?r.editable:!0}):a==="block"?o=i.mergeDeep(r,{dataType:"array",propertyConfig:"block",editable:r.editable!==void 0?r.editable:!0,oneOf:{properties:{}}}):a&&l[a]&&(o={...l[a].property,propertyConfig:a}),o}function Ke({value:r,optionDisabled:a,propertyConfig:l,existing:o}){return e.jsx(t.SelectItem,{value:r,disabled:a,className:"flex flex-row items-center",children:e.jsxs("div",{className:t.cn("flex flex-row items-center text-base min-h-[52px]",a?"w-full":""),children:[e.jsx("div",{className:"mr-8",children:e.jsx(i.PropertyConfigBadge,{propertyConfig:l})}),e.jsxs("div",{children:[e.jsx("div",{children:l.name}),e.jsx(t.Typography,{variant:"caption",color:"disabled",className:"max-w-sm",children:o&&a?"You can only switch to widgets that use the same data type":l.description})]})]})})}function Ur({disabled:r,showErrors:a}){const{values:l,setFieldValue:o}=g.useFormikContext(),s=g.getIn(l,"url");return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"col-span-12",children:e.jsxs(t.Select,{disabled:r,position:"item-aligned",onValueChange:n=>{n==="[NONE]"?o("url",!0):o("url",n)},label:"Preview type",renderValue:n=>{switch(n){case"image":return"Image";case"video":return"Video";case"audio":return"Audio";default:return"Display URL"}},value:s??"[NONE]",children:[e.jsx(t.SelectItem,{value:"[NONE]",children:"Display URL"}),e.jsx(t.SelectItem,{value:"image",children:"Image"}),e.jsx(t.SelectItem,{value:"video",children:"Video"}),e.jsx(t.SelectItem,{value:"audio",children:"Audio"})]})}),e.jsx("div",{className:"col-span-12",children:e.jsx(ie,{children:e.jsx(be,{disabled:r,max:!0,min:!0,trim:!0,showErrors:a})})}),e.jsx("div",{className:"col-span-12",children:e.jsx(t.TextField,{name:"defaultValue",disabled:r,onChange:n=>{o("defaultValue",n.target.value===""?void 0:n.target.value)},label:"Default value",value:g.getIn(l,"defaultValue")??""})})]})}const qr=["text_field","multiline","markdown","url","email","select","multi_select","number_input","number_select","multi_number_select","file_upload","multi_file_upload","reference","multi_references","switch","date_time","group","key_value","repeat","block"],We=Object.entries(i.DEFAULT_FIELD_CONFIGS).filter(([r])=>qr.includes(r)).map(([r,a])=>({[r]:a})).reduce((r,a)=>({...r,...a}),{}),Ze=C.memo(function({includeIdAndName:a=!0,autoOpenTypeSelect:l,existingProperty:o,autoUpdateId:s,inArray:n,propertyKey:d,propertyNamespace:h,property:f,onPropertyChanged:u,onPropertyChangedImmediate:c=!0,onDelete:p,onError:T,initialErrors:m,forceShowErrors:b,existingPropertyKeys:N,allowDataInference:F,getHelpers:w,getData:y,propertyConfigs:P,collectionEditable:x}){const v={id:"",name:""},E=!!(f&&!Ce(f))&&!x,U=C.useRef(f?{id:d,previousId:d,property:f}:void 0),D=({id:V,property:L})=>{const O={id:V,previousId:U.current?.id,property:L,namespace:h};U.current=O,u?.(O)};return e.jsx(g.Formik,{initialErrors:m,initialValues:f?{id:d,...f}:v,onSubmit:(V,L)=>{console.debug("onSubmit",V);const{id:O,...S}=V;D({id:O,property:{...S,editable:S.editable??!0}}),o||L.resetForm({values:v})},children:V=>(C.useEffect(()=>{w?.(V)},[V]),e.jsx(Lr,{onPropertyChanged:c?D:void 0,onDelete:p,includeIdAndTitle:a,propertyNamespace:h,onError:T,showErrors:b||V.submitCount>0,existing:o,autoUpdateId:s,inArray:n,autoOpenTypeSelect:l,existingPropertyKeys:N,disabled:E,getData:y,allowDataInference:F,propertyConfigs:P,collectionEditable:x,...V}))},`property_view_${d}`)},(r,a)=>r.getData===a.getData&&r.includeIdAndName===a.includeIdAndName&&r.autoOpenTypeSelect===a.autoOpenTypeSelect&&r.autoUpdateId===a.autoUpdateId&&r.existingProperty===a.existingProperty);function ge({open:r,onCancel:a,onOkClicked:l,onPropertyChanged:o,getData:s,collectionEditable:n,...d}){const h=C.useRef(),f=u=>{h.current=u};return e.jsxs(t.Dialog,{open:r??!1,maxWidth:"xl",fullWidth:!0,children:[e.jsx(t.DialogContent,{children:e.jsx(Ze,{...d,onPropertyChanged:u=>{o?.(u),l?.()},collectionEditable:n,onPropertyChangedImmediate:!1,getHelpers:f,getData:s})}),e.jsxs(t.DialogActions,{children:[a&&e.jsx(t.Button,{variant:"text",onClick:()=>{a(),h.current?.resetForm()},children:"Cancel"}),e.jsx(t.Button,{variant:"outlined",color:"primary",onClick:()=>h.current?.submitForm(),children:"Ok"})]})]})}function Lr({values:r,errors:a,touched:l,setValues:o,setFieldValue:s,existing:n,autoUpdateId:d=!1,autoOpenTypeSelect:h,includeIdAndTitle:f,onPropertyChanged:u,onDelete:c,propertyNamespace:p,onError:T,showErrors:m,disabled:b,inArray:N,existingPropertyKeys:F,getData:w,allowDataInference:y,propertyConfigs:P,collectionEditable:x}){const[v,E]=C.useState(h),[U,D]=C.useState(!1),[V,L]=C.useState(r?.dataType?i.getFieldId(r):void 0),O=Object.entries(We).concat(Object.entries(P)),S=N?O.filter(([G,Z])=>!i.isPropertyBuilder(Z.property)&&Z.property?.dataType!=="array"):O,z=C.useDeferredValue(r),I=C.useRef(null),k=C.useRef(r),ae=m&&g.getIn(a,"selectedWidget");C.useEffect(()=>{if(u&&(!f||z.id)){const{id:G,...Z}=z;xe(z,k.current)||(u({id:G,property:Z,namespace:p}),k.current=z)}},[z,f,u,p]),C.useEffect(()=>{r?.id&&T&&Object.keys(a).length>0&&T(r?.id,p,a)},[a,T,p,r?.id]);const ce=G=>{L(G),o(He(r,G,P)),setTimeout(()=>{I.current?.focus()},0)};let M;return V==="text_field"||V==="multiline"||V==="markdown"||V==="email"?M=e.jsx(Or,{widgetId:V,disabled:b,showErrors:m}):V==="url"?M=e.jsx(Ur,{disabled:b,showErrors:m}):V==="select"||V==="number_select"?M=e.jsx(Le,{multiselect:!1,allowDataInference:y,updateIds:!n,disabled:b,getData:w,showErrors:m}):V==="multi_select"||V==="multi_number_select"?M=e.jsx(Le,{multiselect:!0,updateIds:!n,disabled:b,allowDataInference:y,getData:w,showErrors:m}):V==="file_upload"?M=e.jsx($e,{existing:n,multiple:!1,disabled:b}):V==="multi_file_upload"?M=e.jsx($e,{existing:n,multiple:!0,disabled:b}):V==="switch"?M=e.jsx(Vr,{disabled:b}):V==="number_input"?M=e.jsx(Dr,{disabled:b}):V==="group"?M=e.jsx(xr,{disabled:b,getData:w,allowDataInference:y,collectionEditable:x,propertyConfigs:P}):V==="block"?M=e.jsx(Er,{disabled:b,getData:w,allowDataInference:y,collectionEditable:x,propertyConfigs:P}):V==="reference"?M=e.jsx(Ge,{showErrors:m,existing:n,multiple:!1,disabled:b}):V==="date_time"?M=e.jsx(Ar,{disabled:b}):V==="multi_references"?M=e.jsx(Ge,{showErrors:m,existing:n,multiple:!0,disabled:b}):V==="repeat"?M=e.jsx(Fr,{showErrors:m,existing:n,getData:w,allowDataInference:y,disabled:b,collectionEditable:x,propertyConfigs:P}):V==="key_value"?M=e.jsx(zr,{disabled:b}):M=null,e.jsxs(e.Fragment,{children:[b&&e.jsxs(t.InfoLabel,{mode:"warn",children:[e.jsx(t.Typography,{children:"This property can't be edited"}),e.jsxs(t.Typography,{variant:"caption",children:["You may not have permission to edit it or it is defined in code with no ",e.jsx("code",{children:"editable"})," flag"]})]}),e.jsxs("div",{className:"flex mt-2 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-2",children:[e.jsx(t.Select,{error:!!ae,value:V??"",placeholder:"Select a property widget",open:v,onOpenChange:E,position:"item-aligned",disabled:b,renderValue:G=>{if(!G)return e.jsx("em",{children:"Select a property widget"});const Z=G,ee=i.DEFAULT_FIELD_CONFIGS[Z]??P[Z],X=ee.property,ue=X&&!i.isPropertyBuilder(X)?i.getFieldConfig(X,P):void 0,re=i.isPropertyBuilder(X)||n&&X.dataType!==r?.dataType,ne=ue?i.mergeDeep(ue,ee):ee;return e.jsxs("div",{onClick:he=>{re&&(he.stopPropagation(),he.preventDefault())},className:t.cn("flex items-center",re?"w-full pointer-events-none opacity-50":""),children:[e.jsx("div",{className:"mr-8",children:e.jsx(i.PropertyConfigBadge,{propertyConfig:ne})}),e.jsxs("div",{className:"flex flex-col items-start text-base text-left",children:[e.jsx("div",{children:ne.name}),e.jsx(t.Typography,{variant:"caption",color:"disabled",children:re?"You can only switch to widgets that use the same data type":ne.description})]})]})},onValueChange:G=>{ce(G)},children:S.map(([G,Z])=>{const ee=Z.property,X=n&&!i.isPropertyBuilder(ee)&&ee.dataType!==r?.dataType;return e.jsx(Ke,{value:G,optionDisabled:X,propertyConfig:Z,existing:n},G)})}),ae&&e.jsx(t.Typography,{variant:"caption",className:"ml-3.5",color:"error",children:"Required"})]}),c&&r?.id&&e.jsx(t.IconButton,{variant:"ghost",className:"m-4",disabled:b,onClick:()=>D(!0),children:e.jsx(t.DeleteIcon,{})})]}),e.jsxs("div",{className:"grid grid-cols-12 gap-y-12 mt-8 mb-8",children:[f&&e.jsx(Nr,{showErrors:m,disabledId:n,isNewProperty:!n,existingPropertyKeys:F,disabled:b,autoUpdateId:d,ref:I}),M,e.jsx("div",{className:"col-span-12",children:e.jsx(Mr,{disabled:b})})]}),c&&e.jsx(i.DeleteConfirmationDialog,{open:U,onAccept:()=>c(r?.id,p),onCancel:()=>D(!1),title:e.jsx("div",{children:"Delete this property?"}),body:e.jsxs("div",{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only modify the collection."]})})]})}function $r(r){return(r.slice(0,1).toLowerCase()+r.slice(1)).replace(/([-_ ]){1,}/g," ").split(/[-_ ]/).reduce((a,l)=>a+l[0].toUpperCase()+l.substring(1),"")}function jr({collection:r,onOpenChange:a,open:l}){const o=i.useSnackbarController(),s=`import { EntityCollection } from "firecms";
|
|
2
|
+
|
|
3
|
+
const `+$r(r.name)+"Collection:EntityCollection = "+pr.stringify(Je(r),null," ");return e.jsxs(t.Dialog,{open:l,onOpenChange:a,maxWidth:"4xl",children:[e.jsxs(t.DialogContent,{children:[e.jsxs(t.Typography,{variant:"h6",className:"my-4",children:["Code for ",r.name]}),e.jsxs(t.Typography,{variant:"body2",className:"my-4 mb-8",children:["If you want to customise the collection in code, you can add this collection code to your CMS app configuration. More info in the ",e.jsx("a",{rel:"noopener noreferrer",href:"https://firecms.co/docs/customization_quickstart",children:"docs"}),"."]}),e.jsx(ze.Highlight,{theme:ze.themes.vsDark,code:s,language:"typescript",children:({className:n,style:d,tokens:h,getLineProps:f,getTokenProps:u})=>e.jsx("pre",{style:d,className:"p-4 rounded text-sm",children:h.map((c,p)=>e.jsx("div",{...f({line:c}),children:c.map((T,m)=>e.jsx("span",{...u({token:T})},m))},p))})})]}),e.jsxs(t.DialogActions,{children:[e.jsxs(t.Button,{variant:"text",size:"small",onClick:n=>(n.stopPropagation(),n.preventDefault(),o.open({type:"success",message:"Copied"}),navigator.clipboard.writeText(s)),children:[e.jsx(t.ContentCopyIcon,{size:"small"}),"Copy to clipboard"]}),e.jsx(t.Button,{onClick:()=>a(!1),children:"Close"})]})]})}function Je(r){const a=l=>{const o={...l};return delete o.fromBuilder,delete o.resolved,delete o.propertiesOrder,delete o.editable,o.type==="map"?{...o,properties:o.properties.map(a)}:o};return{id:r.id,name:r.name,singularName:r.singularName,path:r.path,description:r.description,editable:!0,collectionGroup:r.collectionGroup,icon:r.icon,group:r.group,customId:r.customId,initialFilter:r.initialFilter,initialSort:r.initialSort,properties:Object.entries(r.properties).map(([l,o])=>({[l]:a(o)})).reduce((l,o)=>({...l,...o}),{}),subcollections:(r.subcollections??[]).map(Je)}}function Yr({showErrors:r,isNewCollection:a,propertyErrorsRef:l,onPropertyError:o,setDirty:s,reservedGroups:n,extraIcon:d,getUser:h,getData:f,doCollectionInference:u,propertyConfigs:c,collectionEditable:p}){const{values:T,setFieldValue:m,setFieldError:b,setFieldTouched:N,errors:F,dirty:w}=g.useFormikContext(),y=i.useSnackbarController(),P=i.useLargeLayout(),x=!P,[v,E]=C.useState(),[U,D]=C.useState(),[V,L]=C.useState(),O=U?K(U,V):void 0,S=O?g.getIn(T.properties,O.replaceAll(".",".properties.")):void 0,[z,I]=C.useState(!1),[k,ae]=C.useState(!1),[ce,M]=C.useState(!1),[G,Z]=C.useState([]),ee=C.useRef(T.propertiesOrder?{"":T.propertiesOrder}:{});C.useEffect(()=>{s&&s(w)},[w]);const X=u?()=>{u&&(ae(!0),u(T).then(B=>{if(B&&i.makePropertiesEditable(B.properties),!B){y.open({type:"error",message:"Could not infer properties from data"});return}const j=(B.properties?Object.keys(B.properties):[]).filter(W=>!T.properties[W]);if(j.length===0){y.open({type:"info",message:"No new properties found in existing data"});return}const $={...j.reduce((W,le)=>(W[le]=(B.properties??{})[le],W),{}),...T.properties},J=[...j,...T.propertiesOrder??[]];m("properties",$,!1),re(J),Z(j)}).finally(()=>{ae(!1)}))}:void 0,ue=B=>B?ee.current[B]??g.getIn(T,oe(B)):ee.current[""],re=(B,j)=>{const $=oe(j);m($,B,!1),ee.current[j??""]=B},ne=(B,j)=>{const $=B?K(B,j):void 0;if(!$)throw Error("collection editor miss config");m(te($),void 0,!1);const W=ue(j).filter(le=>le!==B);re(W,j),M(!1),E(void 0),D(void 0),L(void 0)},he=(B,j)=>{m(oe(j),B,!1)},R=({id:B,property:j})=>{if(!B)throw Error("Need to include an ID when creating a new property");m("properties",{...T.properties??{},[B]:j},!1);const $=[...T.propertiesOrder??Object.keys(T.properties),B];re($),M(!1),P&&(E($.indexOf(B)),D(B)),L(void 0)},ye=({id:B,property:j,previousId:$,namespace:J})=>{const W=B?K(B,J):void 0,le=W?te(W):void 0;if($&&$!==B){const Ve=K($,J),Ee=te(Ve),Be=ue(J).map(Te=>Te===$?B:Te).filter(Te=>Te!==void 0);re(Be,J),B&&(E(Be.indexOf(B)),D(B)),m(Ee,void 0,!1),N(Ee,!1,!1)}console.debug("onPropertyChanged",{id:B,property:j,previousId:$,namespace:J,propertyPath:le}),le&&(m(le,j,!1),N(le,!0,!1))},Oe=C.useCallback((B,j,$)=>{const J=B?K(B,j):void 0;if(console.warn("onPropertyErrorInternal",{id:B,namespace:j,error:$,propertyPath:J}),J){const W=$&&Object.keys($).length>0;o(B,j,W?$:void 0),b(te(J),W?"Property error":void 0)}},[]),Me=()=>{E(void 0),D(void 0)},_=U&&l?.current?.properties?l.current.properties[U]:void 0,A=T?.propertiesOrder===void 0||T.propertiesOrder.length===0,Y=T.propertiesOrder?T.propertiesOrder:Object.keys(T.properties),pe=C.useMemo(()=>h(T.ownerId),[h,T.ownerId]),Pe=e.jsxs("div",{className:"grid grid-cols-12 gap-2 h-full bg-gray-50 dark:bg-gray-900",children:[e.jsxs("div",{className:t.cn("p-4 md:p-8 pb-20 md:pb-20","col-span-12 lg:col-span-5 h-full overflow-auto",!x&&"border-r "+t.defaultBorderMixin),children:[e.jsxs("div",{className:"flex my-2",children:[e.jsxs("div",{className:"flex-grow mb-4",children:[e.jsx(g.Field,{name:"name",as:t.DebouncedTextField,invisible:!0,className:"-ml-1",inputClassName:"text-2xl font-headers",placeholder:"Collection name",size:"small",required:!0,error:!!F?.name}),pe&&e.jsxs(t.Typography,{variant:"body2",className:"ml-2",color:"secondary",children:["Created by ",pe.displayName]})]}),d&&e.jsx("div",{className:"ml-4",children:d}),e.jsxs("div",{className:"ml-1 mt-2 flex flex-row gap-2",children:[e.jsx(t.Tooltip,{title:"Get the code for this collection",children:e.jsx(t.IconButton,{variant:"filled",disabled:k,onClick:()=>I(!0),children:e.jsx(t.CodeIcon,{})})}),X&&e.jsx(t.Tooltip,{title:"Add new properties based on data",children:e.jsx(t.IconButton,{variant:"filled",disabled:k,onClick:X,children:k?e.jsx(t.CircularProgress,{size:"small"}):e.jsx(t.AutoAwesomeIcon,{})})}),e.jsx(t.Tooltip,{title:"Add new property",children:e.jsx(t.Button,{variant:"outlined",onClick:()=>M(!0),children:e.jsx(t.AddIcon,{})})})]})]}),e.jsx(i.ErrorBoundary,{children:e.jsx(we,{className:"pl-8",onPropertyClick:(B,j)=>{E(Y.indexOf(B)),D(B),L(j)},inferredPropertyKeys:G,selectedPropertyKey:U?K(U,V):void 0,properties:T.properties,additionalFields:T.additionalFields,propertiesOrder:Y,onPropertyMove:he,onPropertyRemove:a?ne:void 0,collectionEditable:p,errors:r?F:{}})}),e.jsx(t.Button,{className:"mt-8 w-full",color:"primary",variant:"outlined",size:"large",onClick:()=>M(!0),startIcon:e.jsx(t.AddIcon,{}),children:"Add new property"})]}),!x&&e.jsx("div",{className:"col-span-12 lg:col-span-7 ml-2 p-4 md:p-8 h-full overflow-auto pb-20 md:pb-20",children:e.jsxs(t.Paper,{className:"sticky top-8 p-4 min-h-full border border-transparent w-full flex flex-col justify-center ",children:[O&&S&&!i.isPropertyBuilder(S)&&e.jsx(Ze,{inArray:!1,existingProperty:!a,autoUpdateId:!1,allowDataInference:!a,autoOpenTypeSelect:!1,propertyKey:U,propertyNamespace:V,property:S,onPropertyChanged:ye,onDelete:ne,onError:Oe,forceShowErrors:r,initialErrors:_,getData:f,propertyConfigs:c,collectionEditable:p},`edit_view_${v}`),!S&&e.jsx(t.Typography,{variant:"label",className:"flex items-center justify-center h-full",children:A?"Now you can add your first property":"Select a property to edit it"}),S&&i.isPropertyBuilder(S)&&e.jsx(t.Typography,{variant:"label",className:"flex items-center justify-center",children:"This property is defined as a property builder in code"})]})}),x&&e.jsx(ge,{inArray:!1,open:v!==void 0,autoUpdateId:!S,allowDataInference:!a,existingProperty:!0,autoOpenTypeSelect:!1,propertyKey:U,propertyNamespace:V,property:S,onPropertyChanged:ye,onDelete:ne,onError:Oe,forceShowErrors:r,initialErrors:_,getData:f,propertyConfigs:c,collectionEditable:p,onOkClicked:x?Me:void 0},`edit_view_${v}`)]});return e.jsxs(e.Fragment,{children:[Pe,e.jsx(ge,{inArray:!1,existingProperty:!1,autoOpenTypeSelect:!0,autoUpdateId:!0,forceShowErrors:r,open:ce,onCancel:()=>M(!1),onPropertyChanged:R,getData:f,allowDataInference:!a,propertyConfigs:c,collectionEditable:p,existingPropertyKeys:T.propertiesOrder}),e.jsx(jr,{collection:T,open:z,onOpenChange:I})]})}function Gr({open:r,handleOk:a,handleCancel:l,body:o,title:s}){return e.jsxs(t.Dialog,{open:r,onOpenChange:n=>n?l():a(),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[e.jsxs(t.DialogContent,{children:[e.jsx(t.Typography,{variant:"h6",children:s??"Unsaved changes"}),o&&e.jsx(t.Typography,{children:o}),e.jsx(t.Typography,{children:"Are you sure?"})]}),e.jsxs(t.DialogActions,{children:[e.jsx(t.Button,{variant:"text",onClick:l,autoFocus:!0,children:" Cancel "}),e.jsx(t.Button,{onClick:a,children:" Ok "})]})]})}function Hr({open:r,onClose:a}){const{entityViews:l}=i.useCustomizationController();return e.jsxs(t.Dialog,{maxWidth:"md",open:r,children:[e.jsxs(t.DialogContent,{className:"flex flex-col gap-4",children:[e.jsx(t.Typography,{variant:"h6",children:"Select view"}),l?.map(o=>e.jsxs(t.Button,{onClick:()=>a(o.key),fullWidth:!0,variant:"text",children:[o.name," (",o.key,")"]},o.key)),(l??[]).length===0&&e.jsx(t.Typography,{variant:"body2",children:"No custom views defined"})]}),e.jsx(t.DialogActions,{children:e.jsx(t.Button,{variant:"outlined",onClick:()=>a(),children:"Cancel"})})]})}function Kr({collection:r,parentCollection:a,configController:l,collectionInference:o,getUser:s,parentCollectionIds:n}){const{entityViews:d}=i.useCustomizationController(),[h,f]=C.useState(),[u,c]=C.useState(!1),[p,T]=C.useState(),[m,b]=C.useState(),{values:N,setFieldValue:F}=g.useFormikContext(),w=r.subcollections??[],y=N.entityViews?.filter(v=>typeof v=="string").map(v=>i.resolveEntityView(v,d)).filter(Boolean)??[],P=r.entityViews?.filter(v=>typeof v!="string")??[],x=y.length+P.length;return e.jsxs("div",{className:"overflow-auto my-auto",children:[e.jsx(t.Container,{maxWidth:"2xl",className:"flex flex-col gap-4 p-8 m-auto",children:e.jsxs("div",{className:"flex flex-col gap-16",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-4 items-start",children:[e.jsxs(t.Typography,{variant:"h5",children:["Subcollections of ",N.name]}),w&&w.length>0&&e.jsx(t.Paper,{className:"flex flex-col gap-4 p-2 w-full",children:e.jsx(t.Table,{children:e.jsx(t.TableBody,{children:w.map(v=>e.jsxs(t.TableRow,{onClick:()=>b({isNewCollection:!1,editedCollectionPath:v.path}),children:[e.jsx(t.TableCell,{align:"left",children:e.jsx(t.Typography,{variant:"subtitle2",className:"flex-grow",children:v.name})}),e.jsx(t.TableCell,{align:"right",children:e.jsx(t.Tooltip,{title:"Remove",children:e.jsx(t.IconButton,{size:"small",onClick:E=>{E.preventDefault(),E.stopPropagation(),f(v.path)},color:"inherit",children:e.jsx(t.DeleteIcon,{size:"small"})})})})]},v.path))})})}),e.jsx(t.Button,{onClick:()=>{b({isNewCollection:!0})},variant:"outlined",startIcon:e.jsx(t.AddIcon,{}),children:"Add subcollection"})]}),e.jsxs("div",{className:"flex-grow flex flex-col gap-4 items-start",children:[e.jsx(t.Typography,{variant:"h5",children:"Custom views"}),x>0&&e.jsx(e.Fragment,{children:e.jsx(t.Paper,{className:"flex flex-col gap-4 p-2 w-full",children:e.jsx(t.Table,{children:e.jsxs(t.TableBody,{children:[y.map(v=>e.jsxs(t.TableRow,{children:[e.jsx(t.TableCell,{align:"left",children:e.jsx(t.Typography,{variant:"subtitle2",className:"flex-grow",children:v.name})}),e.jsx(t.TableCell,{align:"right",children:e.jsx(t.Tooltip,{title:"Remove",children:e.jsx(t.IconButton,{size:"small",onClick:E=>{E.preventDefault(),E.stopPropagation(),T(v.key)},color:"inherit",children:e.jsx(t.DeleteIcon,{size:"small"})})})})]},v.key)),P.map(v=>e.jsx(t.TableRow,{children:e.jsxs(t.TableCell,{align:"left",children:[e.jsx(t.Typography,{variant:"subtitle2",className:"flex-grow",children:v.name}),e.jsxs(t.Typography,{variant:"caption",className:"flex-grow",children:["This view is defined in code with key ",e.jsx("code",{children:v.key})]})]})},v.key))]})})})}),x===0&&e.jsxs(t.InfoLabel,{children:[e.jsx("b",{children:"COMING SOON"})," Define your own custom views by uploading it with the CLI"]}),e.jsx(t.Button,{onClick:()=>{c(!0)},variant:"outlined",startIcon:e.jsx(t.AddIcon,{}),children:"Add custom entity view"})]})]})}),e.jsx("div",{style:{height:"52px"}}),h&&e.jsx(i.DeleteConfirmationDialog,{open:!!h,onAccept:()=>{l.deleteCollection({path:h,parentCollectionIds:[...n??[],r.path]}),f(void 0)},onCancel:()=>f(void 0),title:e.jsx(e.Fragment,{children:"Delete this subcollection?"}),body:e.jsxs(e.Fragment,{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only the collection in the CMS"]})}),p&&e.jsx(i.DeleteConfirmationDialog,{open:!!p,onAccept:()=>{F("entityViews",N.entityViews?.filter(v=>v!==p)),T(void 0)},onCancel:()=>T(void 0),title:e.jsx(e.Fragment,{children:"Remove this view?"}),body:e.jsxs(e.Fragment,{children:["This will ",e.jsx("b",{children:"not delete any data"}),", only the view in the CMS"]})}),e.jsx(tr,{open:!!m,configController:l,parentCollection:r,collectionInference:o,parentCollectionIds:[...n??[],N.id],isNewCollection:!1,...m,getUser:s,handleClose:()=>{b(void 0)}}),e.jsx(Hr,{open:u,onClose:v=>{v&&F("entityViews",[...N.entityViews??[],v]),c(!1)}})]})}const Qe={id:"products",path:"products",name:"Products",singularName:"Product",icon:"shopping_cart",description:"List of the products currently sold in your shop",properties:i.makePropertiesEditable({name:{dataType:"string",name:"Name",description:"Name of this product",validation:{required:!0}},brand:{dataType:"string",name:"Brand",validation:{required:!0}},description:{dataType:"string",name:"Description",description:"Description of this product, supports markdown",markdown:!0},main_image:{dataType:"string",name:"Image",storage:{storagePath:"images",acceptedFiles:["image/*"]},description:"Upload field for images"},available:{dataType:"boolean",name:"Available",columnWidth:100,description:"Is this product available in the website"},price:{dataType:"number",name:"Price",validation:{requiredMessage:"You must set a positive price",min:0}},images:{dataType:"array",name:"Images",hideFromCollection:!0,of:{dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"]}}},related_products:{dataType:"array",name:"Related products",description:"Products related to this one",of:{dataType:"reference",path:"products"}},metadata:{name:"Metadata",description:"This is an example of a map property",dataType:"map",keyValue:!0},added_on:{dataType:"date",name:"Added on",autoValue:"on_create"}})},Xe={id:"blog",path:"blog",name:"Blog",singularName:"Blog entry",icon:"article",description:"A collection of blog entries",defaultSize:"l",properties:i.makePropertiesEditable({name:{name:"Name",validation:{required:!0},dataType:"string"},header_image:{name:"Header image",dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"],metadata:{cacheControl:"max-age=1000000"}}},content:{name:"Content",description:"Content blocks for the blog entry",validation:{required:!0},dataType:"array",oneOf:{typeField:"type",valueField:"value",properties:{text:{dataType:"string",name:"Text",markdown:!0},quote:{dataType:"string",name:"Quote",multiline:!0},images:{name:"Images",dataType:"array",of:{dataType:"string",storage:{storagePath:"images",acceptedFiles:["image/*"],metadata:{cacheControl:"max-age=1000000"}}},description:"This fields allows uploading multiple images at once and reordering"},products:{name:"Products",dataType:"array",of:{dataType:"reference",path:"products",previewProperties:["name","main_image"]}}},propertiesOrder:["text","quote","images","products"]}},created_on:{name:"Created on",dataType:"date",autoValue:"on_create"},status:{name:"Status",validation:{required:!0},dataType:"string",enumValues:{published:{id:"published",label:"Published"},draft:"Draft"},defaultValue:"draft"},publish_date:{name:"Publish date",dataType:"date",clearable:!0},reviewed:{name:"Reviewed",dataType:"boolean"},tags:{name:"Tags",description:"Example of generic array",dataType:"array",of:{dataType:"string",previewAsTag:!0}}}),initialFilter:{status:["==","published"]}},Re={id:"users",path:"users",name:"Users",singularName:"User",description:"Registered users in the app/web",icon:"person",properties:i.makePropertiesEditable({displayName:{name:"Display name",dataType:"string"},email:{name:"Email",dataType:"string",email:!0},emailVerified:{name:"Email verified",dataType:"boolean"},phone:{name:"Phone",dataType:"string"},favourite_products:{name:"Favourite products",dataType:"array",of:{dataType:"reference",path:"products"}},photoURL:{name:"Photo URL",dataType:"string",url:"image"}})},er={id:"pages",path:"pages",name:"Pages",singularName:"Page",icon:"insert_drive_file",description:"List of website pages that can be edited here",properties:{title:{dataType:"string",name:"Page Title",validation:{required:!0}},slug:{dataType:"string",name:"URL Slug",validation:{required:!0,unique:!0,matches:/^[a-z0-9]+(?:-[a-z0-9]+)*$/,matchesMessage:"Must be lowercase, alphanumeric, and hyphenated"}},hero_section:{dataType:"map",name:"Hero Section",properties:{headline:{dataType:"string",name:"Headline",validation:{required:!0}},subhead:{dataType:"string",name:"Subheadline"},background_image:{dataType:"string",name:"Background Image",storage:{storagePath:"page_hero/images",acceptedFiles:["image/*"]}},call_to_action:{dataType:"string",name:"Call to Action"},call_to_action_link:{dataType:"string",name:"CTA Link",url:!0}}},content:{dataType:"array",name:"Content",oneOf:{properties:{section:{dataType:"map",name:"Section",properties:{title:{dataType:"string",name:"Section Title",validation:{required:!0}},content:{dataType:"string",name:"Section Content",markdown:!0},image:{dataType:"string",name:"Section Image",storage:{storagePath:"page_sections/images",acceptedFiles:["image/*"]}},link:{dataType:"string",name:"Section Link",url:!0}}},image:{dataType:"string",name:"Image",storage:{storagePath:"page_sections/images",acceptedFiles:["image/*"]}},slider:{dataType:"array",name:"Slider",of:{dataType:"map",properties:{title:{dataType:"string",name:"Title",validation:{required:!0}},image:{dataType:"string",storage:{storagePath:"page_sections/images",acceptedFiles:["image/*"]}}}}}}}},sidebar:{dataType:"map",name:"Sidebar",properties:{title:{dataType:"string",name:"Sidebar Title",validation:{required:!1}},content:{dataType:"string",name:"Sidebar Content",markdown:!0}}},seo_metadata:{dataType:"map",name:"SEO Metadata",properties:{meta_title:{dataType:"string",name:"Meta Title"},meta_description:{dataType:"string",name:"Meta Description"},focus_keywords:{dataType:"array",name:"Focus Keywords",of:{dataType:"string"}}}},footer_override:{dataType:"string",name:"Footer Override",markdown:!0},publish_date:{dataType:"date",name:"Publish Date",validation:{required:!0}},last_updated:{dataType:"date",name:"Last Updated",autoValue:"on_update"},is_published:{dataType:"boolean",name:"Is Published",columnWidth:100,description:"Should this page be live on the site?"},author_uid:{dataType:"reference",name:"Author",path:"users"}}};function Wr({path:r,pathSuggestions:a,parentCollection:l,onContinue:o,collections:s}){const[n,d]=C.useState(!1),[h,f]=C.useState();C.useEffect(()=>{a&&s&&(d(!0),a(r).then(y=>{const P=y.filter(x=>!s.find(v=>v.path.trim().toLowerCase()===x.trim().toLowerCase()));f(P)}).finally(()=>d(!1)))},[s,r,a]);const{values:u,setFieldValue:c,setValues:p,handleChange:T,touched:m,errors:b,setFieldTouched:N,isSubmitting:F,submitCount:w}=g.useFormikContext();return e.jsx("div",{className:"overflow-auto my-auto",children:e.jsxs(t.Container,{maxWidth:"4xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsx("div",{className:"flex flex-row py-2 pt-3 items-center",children:e.jsx(t.Typography,{variant:"h4",className:"flex-grow",children:"New collection"})}),l&&e.jsx(t.Chip,{colorScheme:"tealDarker",children:e.jsxs(t.Typography,{variant:"caption",children:["This is a subcollection of ",e.jsx("b",{children:l.name})]})}),e.jsxs("div",{className:"my-2",children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",children:"● Use one of the existing paths in your database:"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 items-center my-2 min-h-7",children:[n&&!h&&e.jsx(t.CircularProgress,{size:"small"}),h?.map((y,P)=>e.jsx(t.Chip,{colorScheme:"cyanLighter",onClick:()=>{c("name",i.unslugify(y)),c("id",y),c("path",y),c("properties",void 0),o()},size:"small",children:y},y)),!n&&(h??[])?.length===0&&e.jsx(t.Typography,{variant:"caption",children:"No suggestions"})]})]}),e.jsxs("div",{className:"my-2",children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",children:"● Select a template:"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(Ie,{title:"Products",subtitle:"A collection of products with images, prices and stock",icon:e.jsx(t.Icon,{size:"small",iconKey:Qe.icon}),onClick:()=>{p(Qe),o()}}),e.jsx(Ie,{title:"Users",subtitle:"A collection of users with emails, names and roles",icon:e.jsx(t.Icon,{size:"small",iconKey:Re.icon}),onClick:()=>{p(Re),o()}}),e.jsx(Ie,{title:"Blog posts",subtitle:"A collection of blog posts with images, authors and complex content",icon:e.jsx(t.Icon,{size:"small",iconKey:Xe.icon}),onClick:()=>{p(Xe),o()}}),e.jsx(Ie,{title:"Pages",subtitle:"A collection of pages with images, authors and complex content",icon:e.jsx(t.Icon,{size:"small",iconKey:er.icon}),onClick:()=>{p(er),o()}})]})]}),!l&&e.jsxs("div",{children:[e.jsx(t.Typography,{variant:"caption",color:"secondary",className:"mb-2",children:"● Create a collection from a file (csv, json, xls, xslx...)"}),e.jsx(se.ImportFileUpload,{onDataAdded:y=>o(y)})]}),e.jsx("div",{children:e.jsx(t.Button,{variant:"text",onClick:()=>o(),className:"my-2",children:"Continue from scratch"})})]})})}function Ie({title:r,subtitle:a,icon:l,onClick:o}){return e.jsx(t.Tooltip,{title:a,children:e.jsxs(t.Card,{onClick:o,className:t.cn("my-2 rounded-md border mx-0 p-6 px-4 focus:outline-none transition ease-in-out duration-150 flex flex-row gap-4 items-center","text-gray-700 dark:text-gray-300","hover:border-primary-dark hover:text-primary-dark dark:hover:text-primary focus:ring-primary hover:ring-1 hover:ring-primary","border-gray-400 dark:border-gray-600 "),children:[l,e.jsx("div",{className:"flex flex-col items-start",children:e.jsx(t.Typography,{variant:"subtitle1",children:r})})]})})}function Zr({importConfig:r,propertyConfigs:a,collectionEditable:l}){const{setFieldValue:o,setFieldTouched:s,values:n}=g.useFormikContext(),[d,h]=C.useState(void 0),f=C.useRef(n.propertiesOrder?{"":n.propertiesOrder}:{}),u=d?d.id:void 0,c=d||void 0,p=({id:m,property:b,previousId:N,namespace:F})=>{const w=m?K(m,F):void 0,y=w?te(w):void 0,P=v=>v?f.current[v]??g.getIn(n,oe(v)):f.current[""],x=(v,E)=>{const U=oe(E);o(U,v,!1),f.current[E??""]=v};if(N&&N!==m){const v=K(N,F),E=te(v),D=P(F).map(L=>L===N?m:L).filter(L=>L!==void 0);x(D,F);const V={...r.headersMapping};Object.keys(V).forEach(L=>{V[L]===N&&(V[L]=m??"")}),r.setHeadersMapping(V),o(E,void 0,!1),s(E,!1,!1)}y&&(o(y,b,!1),s(y,!0,!1))},T=async({id:m,importKey:b,property:N,namespace:F})=>{const w=m?K(m,F):void 0,y=w?te(w):void 0,P=r.importData.map(v=>g.getIn(v,b)),x={...De.buildPropertyFromData(P,N,se.getInferenceType),editable:!0};y&&(x?o(y,x,!1):o(y,N,!1),s(y,!0,!1))};return e.jsxs("div",{className:"overflow-auto my-auto bg-gray-50 dark:bg-gray-900",children:[e.jsxs(t.Container,{maxWidth:"6xl",className:"flex flex-col gap-4 p-8 m-auto",children:[e.jsx(t.Typography,{variant:"h6",className:"mt-4",children:"Data property mapping"}),e.jsx(se.DataNewPropertiesMapping,{headersMapping:r.headersMapping,idColumn:r.idColumn,originProperties:r.originProperties,destinationProperties:n.properties,onIdPropertyChanged:m=>r.setIdColumn(m),buildPropertyView:({property:m,propertyKey:b,importKey:N})=>e.jsx(se.ImportNewPropertyFieldPreview,{property:m,propertyKey:b,onPropertyNameChanged:(F,w)=>o(`properties.${F}.name`,w,!1),onEditClick:()=>{!b||!m||h({...m,id:b,editable:!0})},propertyTypeView:e.jsx(Jr,{property:m,disabled:!1,onPropertyChanged:F=>T({...F,importKey:N}),propertyKey:b,propertyConfigs:a})})})]}),e.jsx(ge,{open:d!==void 0,propertyKey:u,property:c,inArray:!1,autoUpdateId:!1,onPropertyChanged:p,allowDataInference:!1,collectionEditable:l,onOkClicked:()=>{h(void 0)},onCancel:()=>{h(void 0)},autoOpenTypeSelect:!1,existingProperty:!1,propertyConfigs:a}),e.jsx("div",{style:{height:"52px"}})]})}function Jr({property:r,onPropertyChanged:a,propertyKey:l,propertyConfigs:o,disabled:s}){const n=r?i.getFieldId(r):null,d=r?i.getFieldConfig(r,o):null,[h,f]=C.useState(!1);return e.jsx(t.Tooltip,{title:r&&d?`${d?.name} - ${r.dataType}`:void 0,open:h?!1:void 0,children:e.jsx(t.Select,{open:h,onOpenChange:f,invisible:!0,className:"w-full",disabled:s,error:!d,value:n??"",placeholder:"Select a property widget",position:"item-aligned",renderValue:u=>d?e.jsx(i.PropertyConfigBadge,{propertyConfig:d}):null,onValueChange:u=>{const c=He(r,u,o);l&&a({id:l,property:c,previousId:l,namespace:void 0})},children:Object.entries(We).map(([u,c])=>e.jsx(Ke,{value:u,optionDisabled:!1,propertyConfig:c,existing:!1},u))})})}function Qr({importConfig:r,properties:a,propertiesOrder:l}){C.useEffect(()=>{const s=se.getPropertiesMapping(r.originProperties,a),n=r.importData.map(d=>se.convertDataToEntity(d,r.idColumn,r.headersMapping,a,s,"TEMP_PATH"));r.setEntities(n)},[]);const o=i.useSelectionController();return e.jsx(i.EntityCollectionTable,{title:e.jsxs("div",{children:[e.jsx(t.Typography,{variant:"subtitle2",children:"Imported data preview"}),e.jsx(t.Typography,{variant:"caption",children:"Entities with the same id will be overwritten"})]}),tableController:{data:r.entities,dataLoading:!1,noMoreToLoad:!1},endAdornment:e.jsx("div",{className:"h-12"}),filterable:!1,sortable:!1,selectionController:o,displayedColumnIds:l.map(s=>({key:s,disabled:!1})),properties:a})}function rr(r,a=""){const l=Object.keys(r).reduce((n,d)=>{const h=r[d],f=i.slugify(d),u=a?`${a}.${f}`:f;if(h.dataType==="map"&&h.properties){const T=rr(h.properties,u);return{headersMapping:{...n.headersMapping,[d]:u},properties:{...n.properties,[f]:{...h,properties:T.properties,propertiesOrder:Object.keys(T.properties)}}}}const c={...n.properties,[f]:h};return{headersMapping:{...n.headersMapping,[d]:u},properties:c}},{headersMapping:{},properties:{}}),o=Object.keys(l.headersMapping)?.[0];let s;return(o?.includes("id")||o?.includes("key"))&&(s=o),{...l,idColumn:s}}function tr(r){const a=r.open,[l,o]=me.useState(!1),[s,n]=me.useState(!1),d=C.useCallback(()=>{l?n(!0):r.handleClose(void 0)},[l,r.handleClose]);return C.useEffect(()=>{a||(o(!1),n(!1))},[a]),e.jsxs(t.Dialog,{open:a,fullWidth:!0,fullHeight:!0,scrollable:!1,maxWidth:"7xl",onOpenChange:h=>h?void 0:d(),children:[a&&e.jsx(Xr,{...r,handleCancel:d,setFormDirty:o}),e.jsx(Gr,{open:s,handleOk:()=>r.handleClose(void 0),handleCancel:()=>n(!1),body:"There are unsaved changes in this collection"})]})}function Xr({isNewCollection:r,initialValues:a,configController:l,editedCollectionPath:o,parentCollectionIds:s,fullPath:n,collectionInference:d,handleClose:h,reservedGroups:f,extraView:u,handleCancel:c,setFormDirty:p,pathSuggestions:T,getUser:m,parentCollection:b,getData:N}){const{propertyConfigs:F}=i.useCustomizationController(),w=i.useNavigationController(),{topLevelNavigation:y,collections:P}=w,x=!a?.path&&(s??[]).length===0,v=(b?b.subcollections:P)??[],E=v.map(_=>_.path.trim().toLowerCase()),U=v.map(_=>_.id?.trim().toLowerCase()).filter(Boolean),D=se.useImportConfig();if(!y)throw Error("Internal: Navigation not ready in collection editor");const{groups:V}=y,L=i.useSnackbarController(),O=i.useAuthController(),S=C.useRef({}),z=r?x?"welcome":"details":"properties",[I,k]=C.useState(z),[ae,ce]=me.useState(),[M,G]=me.useState(),[Z,ee]=me.useState(!1),[X,ue]=me.useState();C.useEffect(()=>{try{w.initialised&&(G(o?w.getCollectionFromPaths([...s??[],o]):void 0),ee(!0))}catch(_){console.error(_),ue(X)}},[w.getCollectionFromPaths,o,X,w.initialised]);const re=_=>{const A=_.id||_.path;return l.saveCollection({id:A,collectionData:_,previousPath:o,parentCollectionIds:s}).then(()=>(ce(void 0),!0)).catch(Y=>(ce(Y),console.error(Y),L.open({type:"error",message:"Error persisting collection: "+(Y.message??"Details in the console")}),!1))},ne=M?{...M,id:M.id??M.path??i.randomString(16)}:void 0,he=ne?Rr(ne,F):{id:a?.path??i.randomString(16),path:a?.path??"",name:a?.name??"",group:a?.group??"",properties:{},propertiesOrder:[],icon:t.coolIconKeys[Math.floor(Math.random()*t.coolIconKeys.length)],ownerId:O.user?.uid??""},R=C.useCallback(()=>{I==="details"?D.inUse?k("import_data_saving"):k(u?"extra_view":"properties"):k(I==="welcome"?"details":I==="import_data_mapping"?"import_data_preview":I==="import_data_preview"?"details":I==="extra_view"?"properties":"details")},[I,D.inUse,u]),ye=C.useCallback(_=>{if(d)return d?.(_.path,_.collectionGroup??!1,s??[])},[d,s]),Oe=C.useCallback(async _=>{try{if(!ye)return G(_),Promise.resolve(_);k("loading");const A=await ye?.(_);if(!A)return G(_),Promise.resolve(_);const Y={..._??{}};return Object.keys(A.properties??{}).length>0&&(Y.properties=A.properties,Y.propertiesOrder=A.propertiesOrder),Y.propertiesOrder?(G(Y),console.log("Inferred collection",{newCollection:_??{},values:Y}),Y):(Y.propertiesOrder=Object.keys(Y.properties),Y)}catch(A){return console.error(A),L.open({type:"error",message:"Error inferring collection: "+(A.message??"Details in the console")}),_}},[s,ye]),Me=(_,A)=>{try{if(console.log("Submitting collection",_),!r){re(_).then(()=>{A.resetForm({values:he}),h(_)});return}I==="welcome"?(R(),A.resetForm({values:_})):I==="details"?u||D.inUse?(A.resetForm({values:_}),R()):r?Oe(_).then(Y=>{A.resetForm({values:Y??_,touched:{path:!0,name:!0}})}).finally(()=>{R()}):(A.resetForm({values:_}),R()):I==="extra_view"?(R(),A.resetForm({values:_})):I==="import_data_mapping"||I==="import_data_preview"?R():I==="properties"?re(_).then(()=>{A.resetForm({values:he}),R(),h(_)}):(R(),A.resetForm({values:_}))}catch(Y){L.open({type:"error",message:"Error persisting collection: "+(Y.message??"Details in the console")}),console.error(Y),A.resetForm({values:_})}};return!r&&(!w.initialised||!Z)?e.jsx(i.CircularProgressCenter,{}):e.jsx(t.DialogContent,{fullHeight:!0,children:e.jsx(g.Formik,{initialValues:he,validationSchema:(I==="properties"||I==="subcollections"||I==="details")&&fr,validate:_=>{if(I==="properties")return S.current;const A={};if(I==="details"){const Y=lr(_.path,r,E,_.id);Y&&(A.path=Y);const pe=et(_.id,r,E,U);pe&&(A.id=pe)}return A},onSubmit:Me,children:_=>{const{values:A,errors:Y,setFieldValue:pe,isSubmitting:Pe,dirty:B,submitCount:j}=_,$=A.path??o,J=n?.includes("/")?n?.split("/").slice(0,-1).join("/")+"/"+$:$,W=lr($,r,E,A.id),le=!W&&s?w.convertIdsToPaths(s):void 0,Ve=W?void 0:w.resolveAliasesFrom(J),Ee=Ve&&N?()=>N(Ve,le??[]):void 0;C.useEffect(()=>{p(B)},[B]);function sr(Q){D.setInUse(!0),De.buildEntityPropertiesFromData(Q,se.getInferenceType).then(dr=>{const ve=rr(dr);pe("properties",ve.properties),pe("propertiesOrder",Object.keys(ve.properties)),D.setIdColumn(ve.idColumn),D.setImportData(Q),D.setHeadersMapping(ve.headersMapping),D.setOriginProperties(ve.properties)})}const Be=!!A.name&&!!A.id,Te=()=>{const Q={...A.properties};D.idColumn&&delete Q[D.idColumn],pe("properties",Q),R()},ir=M?.editable===void 0||M?.editable===!0||r;return e.jsxs(e.Fragment,{children:[!r&&e.jsxs(t.Tabs,{value:I,className:t.cn(t.defaultBorderMixin,"justify-end bg-gray-50 dark:bg-gray-950 border-b"),onValueChange:Q=>k(Q),children:[e.jsx(t.Tab,{value:"details",children:"Details"}),e.jsx(t.Tab,{value:"properties",children:"Properties"}),e.jsx(t.Tab,{value:"subcollections",children:"Additional views"})]}),e.jsxs(g.Form,{noValidate:!0,className:t.cn(r?"h-full":"h-[calc(100%-48px)]","flex-grow flex flex-col relative"),children:[I==="loading"&&e.jsx(i.CircularProgressCenter,{}),I==="extra_view"&&$&&u?.View&&e.jsx(u.View,{path:$}),I==="welcome"&&e.jsx(Wr,{path:$,onContinue:Q=>{Q?(sr(Q),k("import_data_mapping")):k("details")},collections:P,parentCollection:b,pathSuggestions:T}),I==="import_data_mapping"&&D&&e.jsx(Zr,{importConfig:D,collectionEditable:ir,propertyConfigs:F}),I==="import_data_preview"&&D&&e.jsx(Qr,{importConfig:D,properties:A.properties,propertiesOrder:A.propertiesOrder}),I==="import_data_saving"&&D&&e.jsx(se.ImportSaveInProgress,{importConfig:D,collection:A,onImportSuccess:Q=>{h(Q),L.open({type:"info",message:"Data imported successfully"})}}),I==="details"&&e.jsx(gr,{existingPaths:E,existingIds:U,groups:V,parentCollectionIds:s,parentCollection:b,isNewCollection:r}),I==="subcollections"&&M&&e.jsx(Kr,{parentCollection:b,configController:l,getUser:m,collectionInference:d,parentCollectionIds:s,collection:M}),I==="properties"&&e.jsx(Yr,{showErrors:j>0,isNewCollection:r,reservedGroups:f,onPropertyError:(Q,dr,ve)=>{S.current=i.removeUndefined({...S.current,[Q]:ve},!0)},getUser:m,getData:Ee,doCollectionInference:ye,propertyConfigs:F,collectionEditable:ir,extraIcon:u?.icon&&e.jsx(t.IconButton,{color:"primary",onClick:()=>k("extra_view"),children:u.icon})}),I!=="welcome"&&e.jsxs(t.DialogActions,{position:"absolute",children:[ae&&e.jsx(i.ErrorView,{error:ae}),r&&x&&I==="import_data_mapping"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>(D.setInUse(!1),k("welcome")),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),r&&x&&I==="import_data_preview"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>{re(A),k("import_data_mapping")},children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),r&&x&&I==="details"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>k("welcome"),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),r&&I==="properties"&&e.jsxs(t.Button,{variant:"text",type:"button",onClick:()=>k("details"),children:[e.jsx(t.ArrowBackIcon,{}),"Back"]}),e.jsx(t.Button,{variant:"text",onClick:()=>{c()},children:"Cancel"}),r&&I==="import_data_mapping"&&e.jsx(t.Button,{variant:"filled",color:"primary",onClick:Te,children:"Next"}),r&&I==="import_data_preview"&&e.jsx(t.Button,{variant:"filled",color:"primary",onClick:()=>{R()},children:"Next"}),r&&(I==="details"||I==="properties")&&e.jsxs(t.LoadingButton,{variant:"filled",color:"primary",type:"submit",loading:Pe,disabled:Pe||I==="details"&&!Be,startIcon:I==="properties"?e.jsx(t.DoneIcon,{}):void 0,children:[I==="details"&&"Next",I==="properties"&&"Create collection"]}),!r&&e.jsx(t.LoadingButton,{variant:"filled",color:"primary",type:"submit",loading:Pe,children:"Update collection"})]})]})]})}})})}function Rr(r,a){const{properties:l,...o}=r,s={};return Object.keys(l).forEach(n=>{s[n]=ar(l[n],a)}),{...o,properties:s}}function ar(r,a){let l=r;if(a&&typeof l=="object"&&l.propertyConfig){const o=a[l.propertyConfig];if(o&&i.isPropertyBuilder(o.property))l=o.property;else if(o&&(l=i.mergeDeep(o.property,l)),!i.isPropertyBuilder(l)&&l.dataType==="map"&&l.properties){const s={};Object.keys(l.properties).forEach(n=>{s[n]=ar(l.properties[n],a)}),l={...l,properties:s}}}return l}const lr=(r,a,l,o)=>{let s;return r||(s="You must specify a path in the database for this collection"),a&&l?.includes(r.trim().toLowerCase())&&!o&&(s="There is already a collection with the specified path. If you want to have multiple collections referring to the same database path, make sure the have different ids"),i.removeInitialAndTrailingSlashes(r).split("/").length%2===0&&(s=`Collection paths must have an odd number of segments: ${r}`),s},et=(r,a,l,o)=>{if(!r)return;let s;return a&&l?.includes(r.trim().toLowerCase())&&(s="There is already a collection that uses this value as a path"),a&&o?.includes(r.trim().toLowerCase())&&(s="There is already a collection which uses this id"),s},or=C.createContext({}),nr=C.createContext({}),rt=C.memo(function({children:a,collectionConfigController:l,configPermissions:o,reservedGroups:s,collectionInference:n,extraView:d,pathSuggestions:h,getUser:f,getData:u,onAnalyticsEvent:c}){const p=i.useNavigationController(),T=hr.useNavigate(),m=i.useSnackbarController(),{propertyConfigs:b}=i.useCustomizationController(),{collections:N}=p,F=N.map(S=>S.path.trim().toLowerCase()),[w,y]=C.useState();C.useEffect(()=>{h&&h().then(S=>{y(S.filter(z=>!F.includes(z.trim().toLowerCase())))})},[h]);const[P,x]=C.useState(),[v,E]=C.useState(),U=C.useCallback(()=>({createCollections:!0,editCollections:!0,deleteCollections:!0}),[]),D=C.useCallback(({path:S,fullPath:z,parentCollectionIds:I,parentCollection:k})=>{console.debug("edit collection",S,z,I,k),c?.("edit_collection",{path:S,fullPath:z}),x({editedCollectionPath:S,fullPath:z,parentCollectionIds:I,isNewCollection:!1,parentCollection:k,redirect:!1})},[]),V=C.useCallback(({propertyKey:S,property:z,editedCollectionPath:I,currentPropertiesOrder:k,parentCollectionIds:ae,collection:ce})=>{console.debug("edit property",S,z,I,k,ae,ce),c?.("edit_property",{propertyKey:S,editedCollectionPath:I});const M=S&&S.includes(".")?S.substring(0,S.lastIndexOf(".")):void 0,G=S&&S.includes(".")?S.substring(S.lastIndexOf(".")+1):S;E({propertyKey:G,property:z,namespace:M,currentPropertiesOrder:k,editedCollectionPath:I,parentCollectionIds:ae,collectionEditable:ce?.editable??!1})},[]),L=C.useCallback(({parentCollectionIds:S,parentCollection:z,initialValues:I,redirect:k})=>{console.debug("create collection",S,z,I,k),c?.("create_collection",{parentCollectionIds:S,parentCollection:z,initialValues:I,redirect:k}),x({isNewCollection:!0,parentCollectionIds:S,parentCollection:z,initialValues:I,redirect:k})},[]),O=h?S=>!S&&w?Promise.resolve(w):h?.(S):void 0;return e.jsx(or.Provider,{value:l,children:e.jsxs(nr.Provider,{value:{editCollection:D,createCollection:L,editProperty:V,configPermissions:o??U,rootPathSuggestions:w},children:[a,e.jsx(tr,{open:!!P,configController:l,isNewCollection:!1,collectionInference:n,...P,getData:u,reservedGroups:s,extraView:d,pathSuggestions:O,getUser:f,handleClose:S=>{if(P?.redirect&&S&&P?.isNewCollection&&!P.parentCollectionIds.length){const z=p.buildUrlCollectionPath(S.id??S.path);T(z)}x(void 0)}}),e.jsx(ge,{open:!!v,includeIdAndName:!0,existingProperty:!!v?.propertyKey,autoUpdateId:v?!v?.propertyKey:!1,autoOpenTypeSelect:v?!v?.propertyKey:!1,inArray:!1,collectionEditable:v?.collectionEditable??!1,getData:u&&v?.editedCollectionPath?()=>{console.debug("get data for property",v?.editedCollectionPath);const S=p.resolveAliasesFrom(v.editedCollectionPath);return u(S,[])}:void 0,onPropertyChanged:({id:S,property:z})=>{if(!v||!S)return;const I=!v.propertyKey;return l.saveProperty({path:v?.editedCollectionPath,property:z,propertyKey:S,newPropertiesOrder:I&&v.currentPropertiesOrder?[...v.currentPropertiesOrder,S]:void 0,namespace:v.namespace,parentCollectionIds:v.parentCollectionIds}).catch(k=>(console.error(k),m.open({type:"error",message:"Error persisting property: "+(k.message??"Details in the console")}),!1))},onPropertyChangedImmediate:!1,onDelete:()=>{if(!v?.propertyKey)return;const S=v?.currentPropertiesOrder?.filter(z=>z!==v?.propertyKey);return l.deleteProperty({path:v?.editedCollectionPath,propertyKey:v?.propertyKey,namespace:v?.namespace,newPropertiesOrder:S,parentCollectionIds:v?.parentCollectionIds}).then(()=>{E(void 0)}).catch(z=>(console.error(z),m.open({type:"error",message:"Error deleting property: "+(z.message??"Details in the console")}),!1))},onError:()=>{},onOkClicked:()=>{E(void 0)},onCancel:()=>{E(void 0)},initialErrors:{},forceShowErrors:!1,existingPropertyKeys:[],allowDataInference:!0,propertyConfigs:b,property:v?.property,propertyKey:v?.propertyKey})]})})},xe),de=()=>C.useContext(nr),Ae=()=>C.useContext(or);function tt({path:r,parentCollectionIds:a,collection:l,tableController:o}){const s=i.useAuthController(),n=i.useNavigationController(),d=de(),h=Ae(),f=i.useSnackbarController(),u=n.getCollectionFromIds(a),c=d.configPermissions?d.configPermissions({user:s.user,collection:l}).editCollections:!0;let p=null;(!xe(Se(o.filterValues),Se(l.initialFilter))||!xe(Se(o.sortBy),Se(l.initialSort)))&&(p=e.jsxs(e.Fragment,{children:[l.initialFilter||l.initialSort&&e.jsx(t.Tooltip,{title:"Reset to default filter and sort",children:e.jsx(t.Button,{color:"primary",size:"small",variant:"text",onClick:()=>{o.clearFilter?.(),l?.initialFilter&&o.setFilterValues?.(l?.initialFilter),l?.initialSort&&o.setSortBy?.(l?.initialSort)},children:e.jsx(t.UndoIcon,{})})}),e.jsx(t.Tooltip,{title:o.sortBy||o.filterValues?"Save default filter and sort":"Clear default filter and sort",children:e.jsx(t.Button,{color:"primary",size:"small",variant:"outlined",onClick:()=>h?.saveCollection({id:l.path,parentCollectionIds:a,collectionData:i.mergeDeep(l,{initialFilter:o.filterValues??null,initialSort:o.sortBy??null})}).then(()=>{f.open({type:"success",message:"Default config saved"})}),children:e.jsx(t.SaveIcon,{})})})]}));const T=e.jsx(t.Tooltip,{title:c?"Edit collection":"You don't have permissions to edit this collection",children:e.jsx(t.IconButton,{color:"primary",disabled:!c,onClick:c?()=>d?.editCollection({path:l.path,fullPath:r,parentCollectionIds:a,parentCollection:u}):void 0,children:e.jsx(t.SettingsIcon,{})})});return e.jsxs(e.Fragment,{children:[c&&p,T]})}function Se(r){return r&&Object.keys(r).length===0?r:r??null}function at({path:r,collection:a}){const l=i.useSnackbarController(),o=i.useAuthController(),s=Ae(),n=de(),d=n.configPermissions({user:o.user,collection:a}),h=C.useCallback(()=>{n?.editCollection({path:r,parentCollectionIds:[]})},[n,r]),[f,u]=C.useState(!1),c=C.useCallback(()=>{s?.deleteCollection({path:r}).then(()=>{u(!1),l.open({message:"Collection deleted",type:"success"})})},[r,s]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[d.deleteCollections&&e.jsx(t.Menu,{trigger:e.jsx(t.IconButton,{children:e.jsx(t.MoreVertIcon,{size:"small"})}),children:e.jsxs(t.MenuItem,{onClick:p=>{p.preventDefault(),p.stopPropagation(),u(!0)},children:[e.jsx(t.DeleteIcon,{}),"Delete"]})}),d.editCollections&&e.jsx(t.IconButton,{onClick:p=>{h()},children:e.jsx(t.SettingsIcon,{size:"small"})})]}),e.jsx(i.DeleteConfirmationDialog,{open:f,onAccept:c,onCancel:()=>u(!1),title:e.jsx(e.Fragment,{children:"Delete this collection?"}),body:e.jsxs(e.Fragment,{children:[" This will ",e.jsx("b",{children:"not delete any data"}),", only the collection in the CMS"]})})]})}function lt({group:r,context:a}){if(!a.navigation.topLevelNavigation)throw Error("Navigation not ready in FireCMSHomePage");const l=i.useAuthController(),o=de(),s=o.configPermissions?o.configPermissions({user:l.user}).createCollections:!0;return e.jsx(t.Card,{className:t.cn("h-full p-4 min-h-[124px]"),onClick:o&&s?()=>o.createCollection({initialValues:r?{group:r}:void 0,parentCollectionIds:[],redirect:!0}):void 0,children:e.jsxs("div",{className:"flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col",children:[e.jsx(t.AddIcon,{color:"primary",size:"large"}),e.jsx(t.Typography,{color:"primary",variant:"caption",className:"font-medium",children:"Add new collection".toUpperCase()}),!s&&e.jsx(t.Typography,{variant:"caption",children:"You don't have permissions to create collections"})]})})}function ot(){const r=i.useAuthController(),a=i.useNavigationController(),l=de(),o=l.configPermissions?l.configPermissions({user:r.user}).createCollections:!0,s=l.rootPathSuggestions??[],n=s.length>3||a.collections.length===0&&s.length>0;return e.jsx(t.Collapse,{in:n,children:e.jsxs("div",{className:"flex flex-col gap-1 p-2 my-4",children:[e.jsx(t.Typography,{variant:"body2",color:"secondary",children:"Create a collection from your data:"}),e.jsx("div",{className:"flex flex-row gap-1 overflow-scroll no-scrollbar ",children:s.map(d=>e.jsx("div",{children:e.jsx(t.Chip,{icon:e.jsx(t.AddIcon,{size:"small"}),colorScheme:"cyanLighter",onClick:l&&o?()=>l.createCollection({initialValues:{path:d,name:i.unslugify(d)},parentCollectionIds:[],redirect:!0}):void 0,size:"small",children:d})},d))})]})})}function nt({propertyKey:r,onHover:a,property:l,fullPath:o,parentCollectionIds:s,collection:n}){const d=de();return e.jsx(t.Tooltip,{title:"Edit",children:e.jsx(t.IconButton,{className:a?"bg-white dark:bg-gray-950":"hidden",onClick:()=>{d.editProperty({propertyKey:r,property:l,editedCollectionPath:o,parentCollectionIds:s,collection:n})},size:"small",children:e.jsx(t.SettingsIcon,{size:"small"})})})}function st({fullPath:r,parentCollectionIds:a,collection:l}){const o=i.useAuthController(),s=de(),n=s.configPermissions?s.configPermissions({user:o.user,collection:l}).editCollections:!0;return e.jsx(t.Tooltip,{title:n?"Add new property":"You don't have permission to add new properties",children:e.jsx("div",{className:"p-0.5 w-20 h-full flex items-center justify-center cursor-pointer bg-gray-100 bg-opacity-40 hover:bg-gray-100 dark:bg-gray-950 dark:bg-opacity-40 dark:hover:bg-gray-950",onClick:()=>{s.editProperty({editedCollectionPath:r,parentCollectionIds:a,currentPropertiesOrder:i.getDefaultPropertiesOrder(l),collection:l})},children:e.jsx(t.AddIcon,{color:"inherit"})})})}function it(){const r=de();return e.jsxs(t.Button,{className:"min-w-fit",variant:"outlined",onClick:()=>r.createCollection({parentCollectionIds:[],redirect:!0}),children:[e.jsx(t.AddIcon,{}),"New collection"]})}function dt({collectionConfigController:r,modifyCollection:a,configPermissions:l,reservedGroups:o,extraView:s,pathSuggestions:n,getUser:d,collectionInference:h,getData:f,onAnalyticsEvent:u}){const c=p=>{const T=N=>{i.makePropertiesEditable(N.properties),N.subcollections?.forEach(T)},m=r.collections??[];m.forEach(T),console.debug("Collections specified in code:",p),console.debug("Collections stored in the backend",m);const b=i.joinCollectionLists(p,m,[],a);return console.debug("Collections after joining:",b),b};return{name:"Collection Editor",loading:r.loading,collections:{injectCollections:c,CollectionActions:tt},provider:{Component:rt,props:{collectionConfigController:r,configPermissions:l,collectionInference:h,reservedGroups:o,extraView:s,pathSuggestions:n,getUser:d,getData:f,onAnalyticsEvent:u}},homePage:{additionalActions:e.jsx(it,{}),additionalChildrenEnd:e.jsx(ot,{}),CollectionActions:at,AdditionalCards:lt},collectionView:{HeaderAction:nt,AddColumnComponent:st}}}function ct({path:r}){const a=i.useNavigationController(),l=pt(r),o=a.getParentCollectionIds(r),s=de();return e.jsxs("div",{className:"p-1 flex flex-col items-center",children:[e.jsx(i.ErrorView,{error:"No collection for path: "+l}),e.jsx(t.Button,{className:"mx-2",variant:"outlined",size:"small",onClick:()=>{s.createCollection({initialValues:{path:l,name:i.unslugify(l)},parentCollectionIds:o,redirect:!1})},children:"Create"})]})}function pt(r){const a=r.split("/");return a[a.length-1]}q.MissingReferenceWidget=ct,q.editableProperty=Ce,q.getFullId=K,q.idToPropertiesPath=te,q.namespaceToPropertiesOrderPath=oe,q.namespaceToPropertiesPath=qe,q.removeNonEditableProperties=je,q.useCollectionEditorController=de,q.useCollectionEditorPlugin=dt,q.useCollectionsConfigController=Ae,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
2
4
|
//# sourceMappingURL=index.umd.js.map
|