shoelace-rails-ui 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -0
- data/README.md +49 -22
- data/Rakefile +5 -13
- data/app/assets/config/shoelace_rails_ui_manifest.js +1 -0
- data/app/assets/javascripts/shoelace.js +300 -0
- data/app/assets/stylesheets/sl_styles_light.css +455 -0
- data/app/controllers/shoelace/rails/ui/application_controller.rb +8 -0
- data/app/helpers/shoelace/rails/ui/application_helper.rb +11 -0
- data/app/helpers/shoelace/rails/ui/form_helper.rb +442 -0
- data/app/jobs/shoelace/rails/ui/application_job.rb +8 -0
- data/app/mailers/shoelace/rails/ui/application_mailer.rb +10 -0
- data/app/models/shoelace/rails/ui/application_record.rb +9 -0
- data/app/views/layouts/shoelace/rails/ui/application.html.erb +15 -0
- data/config/routes.rb +2 -0
- data/lib/shoelace/rails/ui/engine.rb +15 -0
- data/lib/shoelace/rails/ui/version.rb +1 -3
- data/lib/shoelace/rails/ui.rb +2 -4
- data/lib/tasks/shoelace/rails/ui_tasks.rake +4 -0
- metadata +36 -334
- data/.DS_Store +0 -0
- data/CHANGELOG.md +0 -5
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -12
- data/Gemfile.lock +0 -42
- data/LICENSE.txt +0 -21
- data/README-real.md +0 -24
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/regenerate.rb +0 -48
- data/remote-src/.DS_Store +0 -0
- data/remote-src/2.0.0.beta64/.DS_Store +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/.editorconfig +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/.github/CODE_OF_CONDUCT.md +0 -44
- data/remote-src/2.0.0.beta64/shoelace-next/.github/FUNDING.yml +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/bug_report.md +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/config.yml +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/.github/SECURITY.md +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/node.js.yml +0 -30
- data/remote-src/2.0.0.beta64/shoelace-next/.github/workflows/release.yml +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/.gitignore +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/.husky/pre-commit +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/.prettierignore +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/extensions.json +0 -9
- data/remote-src/2.0.0.beta64/shoelace-next/.vscode/settings.json +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/CONTRIBUTING.md +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/LICENSE.md +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/README.md +0 -94
- data/remote-src/2.0.0.beta64/shoelace-next/cspell.json +0 -110
- data/remote-src/2.0.0.beta64/shoelace-next/custom-elements-manifest.config.js +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/docs/404.md +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/docs/_sidebar.md +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/icons/sprite.svg +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/chrome.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/edge.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/firefox.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/logo.svg +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/og-image.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/opera.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/safari.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/shoe.svg +0 -134
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/tie.webp +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/touch-icon.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/twitter-card.png +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-content-team.svg +0 -80
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/undraw-not-found.svg +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/walk.gif +0 -0
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/images/wordmark.svg +0 -7
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.css +0 -228
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/code-block/code-block.js +0 -376
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/metadata/metadata.js +0 -537
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/scroll-position/scroll-position.js +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/lunr.min.js +0 -1311
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.css +0 -180
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/search/search.js +0 -293
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.css +0 -29
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/plugins/theme-picker/theme-picker.js +0 -83
- data/remote-src/2.0.0.beta64/shoelace-next/docs/assets/styles/docs.css +0 -642
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/alert.md +0 -441
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animated-image.md +0 -128
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/animation.md +0 -351
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/avatar.md +0 -201
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/badge.md +0 -191
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb-item.md +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/breadcrumb.md +0 -266
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button-group.md +0 -470
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/button.md +0 -453
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/card.md +0 -311
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/checkbox.md +0 -71
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/color-picker.md +0 -101
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/details.md +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dialog.md +0 -265
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/divider.md +0 -152
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/drawer.md +0 -452
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/dropdown.md +0 -389
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-bytes.md +0 -126
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-date.md +0 -120
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/format-number.md +0 -124
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon-button.md +0 -160
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/icon.md +0 -711
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/image-comparer.md +0 -51
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/include.md +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/input.md +0 -283
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-item.md +0 -255
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu-label.md +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/menu.md +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/mutation-observer.md +0 -196
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-bar.md +0 -144
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/progress-ring.md +0 -178
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/qr-code.md +0 -167
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio-group.md +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/radio.md +0 -59
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/range.md +0 -180
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/rating.md +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/relative-time.md +0 -105
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/resize-observer.md +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/responsive-media.md +0 -73
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/select.md +0 -457
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/skeleton.md +0 -439
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/spinner.md +0 -86
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/split-panel.md +0 -671
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/switch.md +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-group.md +0 -359
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab-panel.md +0 -41
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tab.md +0 -29
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tag.md +0 -142
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/textarea.md +0 -184
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/tooltip.md +0 -410
- data/remote-src/2.0.0.beta64/shoelace-next/docs/components/visually-hidden.md +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/angular.md +0 -46
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/react.md +0 -156
- data/remote-src/2.0.0.beta64/shoelace-next/docs/frameworks/vue.md +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/customizing.md +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/form-controls.md +0 -336
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/installation.md +0 -137
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/localization.md +0 -140
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/overview.md +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/themes.md +0 -139
- data/remote-src/2.0.0.beta64/shoelace-next/docs/getting-started/usage.md +0 -173
- data/remote-src/2.0.0.beta64/shoelace-next/docs/index.html +0 -98
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/accessibility.md +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/changelog.md +0 -925
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/community.md +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/docs/resources/contributing.md +0 -261
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/border-radius.md +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/color.md +0 -439
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/elevation.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/spacing.md +0 -16
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/transition.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/typography.md +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tokens/z-index.md +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-laravel.md +0 -117
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-nextjs.md +0 -137
- data/remote-src/2.0.0.beta64/shoelace-next/docs/tutorials/integrating-with-rails.md +0 -103
- data/remote-src/2.0.0.beta64/shoelace-next/lint-staged.config.js +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/package-lock.json +0 -9534
- data/remote-src/2.0.0.beta64/shoelace-next/package.json +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/prettier.config.cjs +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/build.js +0 -158
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-css.js +0 -42
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-icons.js +0 -71
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-metadata.js +0 -11
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-react.js +0 -63
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-search.js +0 -100
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/make-vscode-data.js +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/plopfile.js +0 -67
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/component.hbs +0 -44
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/docs.hbs +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/styles.hbs +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/plop/templates/component/tests.hbs +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/scripts/shared.js +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.styles.ts +0 -95
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.test.ts +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/alert/alert.ts +0 -238
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.styles.ts +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animated-image/animated-image.ts +0 -120
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animation.ts +0 -222
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/animation/animations.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.styles.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.test.ts +0 -111
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/avatar/avatar.ts +0 -83
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.styles.ts +0 -94
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.test.ts +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/badge/badge.ts +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.styles.ts +0 -12
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.test.ts +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb/breadcrumb.ts +0 -82
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.styles.ts +0 -85
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.test.ts +0 -160
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/breadcrumb-item/breadcrumb-item.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.styles.ts +0 -637
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button/button.ts +0 -209
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.styles.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/button-group/button-group.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.styles.ts +0 -62
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.test.ts +0 -139
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/card/card.ts +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.styles.ts +0 -108
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.test.ts +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/checkbox/checkbox.ts +0 -203
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.styles.ts +0 -326
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.test.ts +0 -43
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/color-picker/color-picker.ts +0 -853
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.styles.ts +0 -73
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.test.ts +0 -153
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/details/details.ts +0 -192
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.styles.ts +0 -106
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.test.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dialog/dialog.ts +0 -296
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.styles.ts +0 -25
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/divider/divider.ts +0 -34
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.styles.ts +0 -142
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.test.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/drawer/drawer.ts +0 -377
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.styles.ts +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.test.ts +0 -147
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/dropdown/dropdown.ts +0 -459
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-bytes/format-bytes.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-date/format-date.ts +0 -81
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/format-number/format-number.ts +0 -69
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.styles.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/icon.ts +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.default.ts +0 -9
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.system.ts +0 -97
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/library.ts +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon/request.ts +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.styles.ts +0 -48
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/icon-button/icon-button.ts +0 -100
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.styles.ts +0 -77
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/image-comparer/image-comparer.ts +0 -147
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.test.ts +0 -62
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/include.ts +0 -80
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/include/request.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.styles.ts +0 -282
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.test.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/input/input.ts +0 -410
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.styles.ts +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu/menu.ts +0 -205
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.styles.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-item/menu-item.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.styles.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/menu-label/menu-label.ts +0 -30
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/mutation-observer/mutation-observer.ts +0 -118
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.styles.ts +0 -57
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.test.ts +0 -89
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-bar/progress-bar.ts +0 -74
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.styles.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.test.ts +0 -68
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/progress-ring/progress-ring.ts +0 -84
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.styles.ts +0 -22
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/qr-code/qr-code.ts +0 -90
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.styles.ts +0 -107
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.test.ts +0 -65
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio/radio.ts +0 -226
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.styles.ts +0 -47
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/radio-group/radio-group.ts +0 -66
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.styles.ts +0 -192
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/range/range.ts +0 -273
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.styles.ts +0 -79
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/rating/rating.ts +0 -249
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/relative-time/relative-time.ts +0 -116
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.styles.ts +0 -10
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/resize-observer/resize-observer.ts +0 -87
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.styles.ts +0 -36
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/responsive-media/responsive-media.ts +0 -50
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.styles.ts +0 -331
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.test.ts +0 -56
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/select/select.ts +0 -560
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.styles.ts +0 -60
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/skeleton/skeleton.ts +0 -46
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.styles.ts +0 -56
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.test.ts +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/spinner/spinner.ts +0 -34
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.styles.ts +0 -76
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.test.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/split-panel/split-panel.ts +0 -272
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.styles.ts +0 -135
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.test.ts +0 -64
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/switch/switch.ts +0 -187
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.styles.ts +0 -61
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab/tab.ts +0 -104
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.styles.ts +0 -209
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-group/tab-group.ts +0 -409
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.styles.ts +0 -17
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tab-panel/tab-panel.ts +0 -49
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.styles.ts +0 -110
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tag/tag.ts +0 -92
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.styles.ts +0 -167
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.test.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/textarea/textarea.ts +0 -339
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.styles.ts +0 -131
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.test.ts +0 -117
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/tooltip/tooltip.ts +0 -355
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.styles.ts +0 -18
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.test.ts +0 -39
- data/remote-src/2.0.0.beta64/shoelace-next/src/components/visually-hidden/visually-hidden.ts +0 -24
- data/remote-src/2.0.0.beta64/shoelace-next/src/declaration.d.ts +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/animate.ts +0 -70
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/event.ts +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/focus-visible.ts +0 -26
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/form-control.ts +0 -203
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/formdata-event-polyfill.ts +0 -93
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/math.ts +0 -8
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/modal.ts +0 -53
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/number.ts +0 -32
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/offset.ts +0 -13
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/scroll.ts +0 -57
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/slot.ts +0 -91
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/string.ts +0 -3
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/support.ts +0 -15
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/tabbable.ts +0 -81
- data/remote-src/2.0.0.beta64/shoelace-next/src/internal/watch.ts +0 -40
- data/remote-src/2.0.0.beta64/shoelace-next/src/shoelace.ts +0 -58
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/component.styles.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/form-control.styles.ts +0 -52
- data/remote-src/2.0.0.beta64/shoelace-next/src/styles/utility.styles.ts +0 -23
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/dark.styles.ts +0 -524
- data/remote-src/2.0.0.beta64/shoelace-next/src/themes/light.styles.ts +0 -524
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de-ch.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/de.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/en.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/es.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/fr.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/he.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ja.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/nl.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pl.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/pt.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/translations/ru.ts +0 -21
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation-registry.ts +0 -59
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/animation.ts +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/base-path.ts +0 -43
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/form.ts +0 -22
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/icon-library.ts +0 -1
- data/remote-src/2.0.0.beta64/shoelace-next/src/utilities/localize.ts +0 -5
- data/remote-src/2.0.0.beta64/shoelace-next/tsconfig.json +0 -35
- data/remote-src/2.0.0.beta64/shoelace-next/vercel.json +0 -4
- data/remote-src/2.0.0.beta64/shoelace-next/web-test-runner.config.js +0 -14
- data/shoelace-rails-ui.gemspec +0 -39
- data/shoelace-rails-ui.rb +0 -0
@@ -1,1311 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9
|
3
|
-
* Copyright (C) 2020 Oliver Nightingale
|
4
|
-
* @license MIT
|
5
|
-
*/
|
6
|
-
!(function () {
|
7
|
-
var e = function (t) {
|
8
|
-
var r = new e.Builder();
|
9
|
-
return (
|
10
|
-
r.pipeline.add(e.trimmer, e.stopWordFilter, e.stemmer), r.searchPipeline.add(e.stemmer), t.call(r, r), r.build()
|
11
|
-
);
|
12
|
-
};
|
13
|
-
(e.version = '2.3.9'),
|
14
|
-
(e.utils = {}),
|
15
|
-
(e.utils.warn = (function (e) {
|
16
|
-
return function (t) {
|
17
|
-
e.console && console.warn && console.warn(t);
|
18
|
-
};
|
19
|
-
})(this)),
|
20
|
-
(e.utils.asString = function (e) {
|
21
|
-
return void 0 === e || null === e ? '' : e.toString();
|
22
|
-
}),
|
23
|
-
(e.utils.clone = function (e) {
|
24
|
-
if (null === e || void 0 === e) return e;
|
25
|
-
for (var t = Object.create(null), r = Object.keys(e), i = 0; i < r.length; i++) {
|
26
|
-
var n = r[i],
|
27
|
-
s = e[n];
|
28
|
-
if (Array.isArray(s)) t[n] = s.slice();
|
29
|
-
else {
|
30
|
-
if ('string' != typeof s && 'number' != typeof s && 'boolean' != typeof s)
|
31
|
-
throw new TypeError('clone is not deep and does not support nested objects');
|
32
|
-
t[n] = s;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
return t;
|
36
|
-
}),
|
37
|
-
(e.FieldRef = function (e, t, r) {
|
38
|
-
(this.docRef = e), (this.fieldName = t), (this._stringValue = r);
|
39
|
-
}),
|
40
|
-
(e.FieldRef.joiner = '/'),
|
41
|
-
(e.FieldRef.fromString = function (t) {
|
42
|
-
var r = t.indexOf(e.FieldRef.joiner);
|
43
|
-
if (r === -1) throw 'malformed field ref string';
|
44
|
-
var i = t.slice(0, r),
|
45
|
-
n = t.slice(r + 1);
|
46
|
-
return new e.FieldRef(n, i, t);
|
47
|
-
}),
|
48
|
-
(e.FieldRef.prototype.toString = function () {
|
49
|
-
return (
|
50
|
-
void 0 == this._stringValue && (this._stringValue = this.fieldName + e.FieldRef.joiner + this.docRef),
|
51
|
-
this._stringValue
|
52
|
-
);
|
53
|
-
}),
|
54
|
-
(e.Set = function (e) {
|
55
|
-
if (((this.elements = Object.create(null)), e)) {
|
56
|
-
this.length = e.length;
|
57
|
-
for (var t = 0; t < this.length; t++) this.elements[e[t]] = !0;
|
58
|
-
} else this.length = 0;
|
59
|
-
}),
|
60
|
-
(e.Set.complete = {
|
61
|
-
intersect: function (e) {
|
62
|
-
return e;
|
63
|
-
},
|
64
|
-
union: function () {
|
65
|
-
return this;
|
66
|
-
},
|
67
|
-
contains: function () {
|
68
|
-
return !0;
|
69
|
-
}
|
70
|
-
}),
|
71
|
-
(e.Set.empty = {
|
72
|
-
intersect: function () {
|
73
|
-
return this;
|
74
|
-
},
|
75
|
-
union: function (e) {
|
76
|
-
return e;
|
77
|
-
},
|
78
|
-
contains: function () {
|
79
|
-
return !1;
|
80
|
-
}
|
81
|
-
}),
|
82
|
-
(e.Set.prototype.contains = function (e) {
|
83
|
-
return !!this.elements[e];
|
84
|
-
}),
|
85
|
-
(e.Set.prototype.intersect = function (t) {
|
86
|
-
var r,
|
87
|
-
i,
|
88
|
-
n,
|
89
|
-
s = [];
|
90
|
-
if (t === e.Set.complete) return this;
|
91
|
-
if (t === e.Set.empty) return t;
|
92
|
-
this.length < t.length ? ((r = this), (i = t)) : ((r = t), (i = this)), (n = Object.keys(r.elements));
|
93
|
-
for (var o = 0; o < n.length; o++) {
|
94
|
-
var a = n[o];
|
95
|
-
a in i.elements && s.push(a);
|
96
|
-
}
|
97
|
-
return new e.Set(s);
|
98
|
-
}),
|
99
|
-
(e.Set.prototype.union = function (t) {
|
100
|
-
return t === e.Set.complete
|
101
|
-
? e.Set.complete
|
102
|
-
: t === e.Set.empty
|
103
|
-
? this
|
104
|
-
: new e.Set(Object.keys(this.elements).concat(Object.keys(t.elements)));
|
105
|
-
}),
|
106
|
-
(e.idf = function (e, t) {
|
107
|
-
var r = 0;
|
108
|
-
for (var i in e) '_index' != i && (r += Object.keys(e[i]).length);
|
109
|
-
var n = (t - r + 0.5) / (r + 0.5);
|
110
|
-
return Math.log(1 + Math.abs(n));
|
111
|
-
}),
|
112
|
-
(e.Token = function (e, t) {
|
113
|
-
(this.str = e || ''), (this.metadata = t || {});
|
114
|
-
}),
|
115
|
-
(e.Token.prototype.toString = function () {
|
116
|
-
return this.str;
|
117
|
-
}),
|
118
|
-
(e.Token.prototype.update = function (e) {
|
119
|
-
return (this.str = e(this.str, this.metadata)), this;
|
120
|
-
}),
|
121
|
-
(e.Token.prototype.clone = function (t) {
|
122
|
-
return (
|
123
|
-
(t =
|
124
|
-
t ||
|
125
|
-
function (e) {
|
126
|
-
return e;
|
127
|
-
}),
|
128
|
-
new e.Token(t(this.str, this.metadata), this.metadata)
|
129
|
-
);
|
130
|
-
}),
|
131
|
-
(e.tokenizer = function (t, r) {
|
132
|
-
if (null == t || void 0 == t) return [];
|
133
|
-
if (Array.isArray(t))
|
134
|
-
return t.map(function (t) {
|
135
|
-
return new e.Token(e.utils.asString(t).toLowerCase(), e.utils.clone(r));
|
136
|
-
});
|
137
|
-
for (var i = t.toString().toLowerCase(), n = i.length, s = [], o = 0, a = 0; o <= n; o++) {
|
138
|
-
var u = i.charAt(o),
|
139
|
-
l = o - a;
|
140
|
-
if (u.match(e.tokenizer.separator) || o == n) {
|
141
|
-
if (l > 0) {
|
142
|
-
var c = e.utils.clone(r) || {};
|
143
|
-
(c.position = [a, l]), (c.index = s.length), s.push(new e.Token(i.slice(a, o), c));
|
144
|
-
}
|
145
|
-
a = o + 1;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
return s;
|
149
|
-
}),
|
150
|
-
(e.tokenizer.separator = /[\s\-]+/),
|
151
|
-
(e.Pipeline = function () {
|
152
|
-
this._stack = [];
|
153
|
-
}),
|
154
|
-
(e.Pipeline.registeredFunctions = Object.create(null)),
|
155
|
-
(e.Pipeline.registerFunction = function (t, r) {
|
156
|
-
r in this.registeredFunctions && e.utils.warn('Overwriting existing registered function: ' + r),
|
157
|
-
(t.label = r),
|
158
|
-
(e.Pipeline.registeredFunctions[t.label] = t);
|
159
|
-
}),
|
160
|
-
(e.Pipeline.warnIfFunctionNotRegistered = function (t) {
|
161
|
-
var r = t.label && t.label in this.registeredFunctions;
|
162
|
-
r ||
|
163
|
-
e.utils.warn(
|
164
|
-
'Function is not registered with pipeline. This may cause problems when serialising the index.\n',
|
165
|
-
t
|
166
|
-
);
|
167
|
-
}),
|
168
|
-
(e.Pipeline.load = function (t) {
|
169
|
-
var r = new e.Pipeline();
|
170
|
-
return (
|
171
|
-
t.forEach(function (t) {
|
172
|
-
var i = e.Pipeline.registeredFunctions[t];
|
173
|
-
if (!i) throw new Error('Cannot load unregistered function: ' + t);
|
174
|
-
r.add(i);
|
175
|
-
}),
|
176
|
-
r
|
177
|
-
);
|
178
|
-
}),
|
179
|
-
(e.Pipeline.prototype.add = function () {
|
180
|
-
var t = Array.prototype.slice.call(arguments);
|
181
|
-
t.forEach(function (t) {
|
182
|
-
e.Pipeline.warnIfFunctionNotRegistered(t), this._stack.push(t);
|
183
|
-
}, this);
|
184
|
-
}),
|
185
|
-
(e.Pipeline.prototype.after = function (t, r) {
|
186
|
-
e.Pipeline.warnIfFunctionNotRegistered(r);
|
187
|
-
var i = this._stack.indexOf(t);
|
188
|
-
if (i == -1) throw new Error('Cannot find existingFn');
|
189
|
-
(i += 1), this._stack.splice(i, 0, r);
|
190
|
-
}),
|
191
|
-
(e.Pipeline.prototype.before = function (t, r) {
|
192
|
-
e.Pipeline.warnIfFunctionNotRegistered(r);
|
193
|
-
var i = this._stack.indexOf(t);
|
194
|
-
if (i == -1) throw new Error('Cannot find existingFn');
|
195
|
-
this._stack.splice(i, 0, r);
|
196
|
-
}),
|
197
|
-
(e.Pipeline.prototype.remove = function (e) {
|
198
|
-
var t = this._stack.indexOf(e);
|
199
|
-
t != -1 && this._stack.splice(t, 1);
|
200
|
-
}),
|
201
|
-
(e.Pipeline.prototype.run = function (e) {
|
202
|
-
for (var t = this._stack.length, r = 0; r < t; r++) {
|
203
|
-
for (var i = this._stack[r], n = [], s = 0; s < e.length; s++) {
|
204
|
-
var o = i(e[s], s, e);
|
205
|
-
if (null !== o && void 0 !== o && '' !== o)
|
206
|
-
if (Array.isArray(o)) for (var a = 0; a < o.length; a++) n.push(o[a]);
|
207
|
-
else n.push(o);
|
208
|
-
}
|
209
|
-
e = n;
|
210
|
-
}
|
211
|
-
return e;
|
212
|
-
}),
|
213
|
-
(e.Pipeline.prototype.runString = function (t, r) {
|
214
|
-
var i = new e.Token(t, r);
|
215
|
-
return this.run([i]).map(function (e) {
|
216
|
-
return e.toString();
|
217
|
-
});
|
218
|
-
}),
|
219
|
-
(e.Pipeline.prototype.reset = function () {
|
220
|
-
this._stack = [];
|
221
|
-
}),
|
222
|
-
(e.Pipeline.prototype.toJSON = function () {
|
223
|
-
return this._stack.map(function (t) {
|
224
|
-
return e.Pipeline.warnIfFunctionNotRegistered(t), t.label;
|
225
|
-
});
|
226
|
-
}),
|
227
|
-
(e.Vector = function (e) {
|
228
|
-
(this._magnitude = 0), (this.elements = e || []);
|
229
|
-
}),
|
230
|
-
(e.Vector.prototype.positionForIndex = function (e) {
|
231
|
-
if (0 == this.elements.length) return 0;
|
232
|
-
for (
|
233
|
-
var t = 0, r = this.elements.length / 2, i = r - t, n = Math.floor(i / 2), s = this.elements[2 * n];
|
234
|
-
i > 1 && (s < e && (t = n), s > e && (r = n), s != e);
|
235
|
-
|
236
|
-
)
|
237
|
-
(i = r - t), (n = t + Math.floor(i / 2)), (s = this.elements[2 * n]);
|
238
|
-
return s == e ? 2 * n : s > e ? 2 * n : s < e ? 2 * (n + 1) : void 0;
|
239
|
-
}),
|
240
|
-
(e.Vector.prototype.insert = function (e, t) {
|
241
|
-
this.upsert(e, t, function () {
|
242
|
-
throw 'duplicate index';
|
243
|
-
});
|
244
|
-
}),
|
245
|
-
(e.Vector.prototype.upsert = function (e, t, r) {
|
246
|
-
this._magnitude = 0;
|
247
|
-
var i = this.positionForIndex(e);
|
248
|
-
this.elements[i] == e ? (this.elements[i + 1] = r(this.elements[i + 1], t)) : this.elements.splice(i, 0, e, t);
|
249
|
-
}),
|
250
|
-
(e.Vector.prototype.magnitude = function () {
|
251
|
-
if (this._magnitude) return this._magnitude;
|
252
|
-
for (var e = 0, t = this.elements.length, r = 1; r < t; r += 2) {
|
253
|
-
var i = this.elements[r];
|
254
|
-
e += i * i;
|
255
|
-
}
|
256
|
-
return (this._magnitude = Math.sqrt(e));
|
257
|
-
}),
|
258
|
-
(e.Vector.prototype.dot = function (e) {
|
259
|
-
for (
|
260
|
-
var t = 0, r = this.elements, i = e.elements, n = r.length, s = i.length, o = 0, a = 0, u = 0, l = 0;
|
261
|
-
u < n && l < s;
|
262
|
-
|
263
|
-
)
|
264
|
-
(o = r[u]),
|
265
|
-
(a = i[l]),
|
266
|
-
o < a ? (u += 2) : o > a ? (l += 2) : o == a && ((t += r[u + 1] * i[l + 1]), (u += 2), (l += 2));
|
267
|
-
return t;
|
268
|
-
}),
|
269
|
-
(e.Vector.prototype.similarity = function (e) {
|
270
|
-
return this.dot(e) / this.magnitude() || 0;
|
271
|
-
}),
|
272
|
-
(e.Vector.prototype.toArray = function () {
|
273
|
-
for (var e = new Array(this.elements.length / 2), t = 1, r = 0; t < this.elements.length; t += 2, r++)
|
274
|
-
e[r] = this.elements[t];
|
275
|
-
return e;
|
276
|
-
}),
|
277
|
-
(e.Vector.prototype.toJSON = function () {
|
278
|
-
return this.elements;
|
279
|
-
}),
|
280
|
-
(e.stemmer = (function () {
|
281
|
-
var e = {
|
282
|
-
ational: 'ate',
|
283
|
-
tional: 'tion',
|
284
|
-
enci: 'ence',
|
285
|
-
anci: 'ance',
|
286
|
-
izer: 'ize',
|
287
|
-
bli: 'ble',
|
288
|
-
alli: 'al',
|
289
|
-
entli: 'ent',
|
290
|
-
eli: 'e',
|
291
|
-
ousli: 'ous',
|
292
|
-
ization: 'ize',
|
293
|
-
ation: 'ate',
|
294
|
-
ator: 'ate',
|
295
|
-
alism: 'al',
|
296
|
-
iveness: 'ive',
|
297
|
-
fulness: 'ful',
|
298
|
-
ousness: 'ous',
|
299
|
-
aliti: 'al',
|
300
|
-
iviti: 'ive',
|
301
|
-
biliti: 'ble',
|
302
|
-
logi: 'log'
|
303
|
-
},
|
304
|
-
t = { icate: 'ic', ative: '', alize: 'al', iciti: 'ic', ical: 'ic', ful: '', ness: '' },
|
305
|
-
r = '[^aeiou]',
|
306
|
-
i = '[aeiouy]',
|
307
|
-
n = r + '[^aeiouy]*',
|
308
|
-
s = i + '[aeiou]*',
|
309
|
-
o = '^(' + n + ')?' + s + n,
|
310
|
-
a = '^(' + n + ')?' + s + n + '(' + s + ')?$',
|
311
|
-
u = '^(' + n + ')?' + s + n + s + n,
|
312
|
-
l = '^(' + n + ')?' + i,
|
313
|
-
c = new RegExp(o),
|
314
|
-
h = new RegExp(u),
|
315
|
-
d = new RegExp(a),
|
316
|
-
f = new RegExp(l),
|
317
|
-
p = /^(.+?)(ss|i)es$/,
|
318
|
-
y = /^(.+?)([^s])s$/,
|
319
|
-
m = /^(.+?)eed$/,
|
320
|
-
v = /^(.+?)(ed|ing)$/,
|
321
|
-
g = /.$/,
|
322
|
-
x = /(at|bl|iz)$/,
|
323
|
-
w = new RegExp('([^aeiouylsz])\\1$'),
|
324
|
-
Q = new RegExp('^' + n + i + '[^aeiouwxy]$'),
|
325
|
-
k = /^(.+?[^aeiou])y$/,
|
326
|
-
S =
|
327
|
-
/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,
|
328
|
-
E = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,
|
329
|
-
L = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,
|
330
|
-
b = /^(.+?)(s|t)(ion)$/,
|
331
|
-
P = /^(.+?)e$/,
|
332
|
-
T = /ll$/,
|
333
|
-
O = new RegExp('^' + n + i + '[^aeiouwxy]$'),
|
334
|
-
I = function (r) {
|
335
|
-
var i, n, s, o, a, u, l;
|
336
|
-
if (r.length < 3) return r;
|
337
|
-
if (
|
338
|
-
((s = r.substr(0, 1)),
|
339
|
-
'y' == s && (r = s.toUpperCase() + r.substr(1)),
|
340
|
-
(o = p),
|
341
|
-
(a = y),
|
342
|
-
o.test(r) ? (r = r.replace(o, '$1$2')) : a.test(r) && (r = r.replace(a, '$1$2')),
|
343
|
-
(o = m),
|
344
|
-
(a = v),
|
345
|
-
o.test(r))
|
346
|
-
) {
|
347
|
-
var I = o.exec(r);
|
348
|
-
(o = c), o.test(I[1]) && ((o = g), (r = r.replace(o, '')));
|
349
|
-
} else if (a.test(r)) {
|
350
|
-
var I = a.exec(r);
|
351
|
-
(i = I[1]),
|
352
|
-
(a = f),
|
353
|
-
a.test(i) &&
|
354
|
-
((r = i),
|
355
|
-
(a = x),
|
356
|
-
(u = w),
|
357
|
-
(l = Q),
|
358
|
-
a.test(r) ? (r += 'e') : u.test(r) ? ((o = g), (r = r.replace(o, ''))) : l.test(r) && (r += 'e'));
|
359
|
-
}
|
360
|
-
if (((o = k), o.test(r))) {
|
361
|
-
var I = o.exec(r);
|
362
|
-
(i = I[1]), (r = i + 'i');
|
363
|
-
}
|
364
|
-
if (((o = S), o.test(r))) {
|
365
|
-
var I = o.exec(r);
|
366
|
-
(i = I[1]), (n = I[2]), (o = c), o.test(i) && (r = i + e[n]);
|
367
|
-
}
|
368
|
-
if (((o = E), o.test(r))) {
|
369
|
-
var I = o.exec(r);
|
370
|
-
(i = I[1]), (n = I[2]), (o = c), o.test(i) && (r = i + t[n]);
|
371
|
-
}
|
372
|
-
if (((o = L), (a = b), o.test(r))) {
|
373
|
-
var I = o.exec(r);
|
374
|
-
(i = I[1]), (o = h), o.test(i) && (r = i);
|
375
|
-
} else if (a.test(r)) {
|
376
|
-
var I = a.exec(r);
|
377
|
-
(i = I[1] + I[2]), (a = h), a.test(i) && (r = i);
|
378
|
-
}
|
379
|
-
if (((o = P), o.test(r))) {
|
380
|
-
var I = o.exec(r);
|
381
|
-
(i = I[1]), (o = h), (a = d), (u = O), (o.test(i) || (a.test(i) && !u.test(i))) && (r = i);
|
382
|
-
}
|
383
|
-
return (
|
384
|
-
(o = T),
|
385
|
-
(a = h),
|
386
|
-
o.test(r) && a.test(r) && ((o = g), (r = r.replace(o, ''))),
|
387
|
-
'y' == s && (r = s.toLowerCase() + r.substr(1)),
|
388
|
-
r
|
389
|
-
);
|
390
|
-
};
|
391
|
-
return function (e) {
|
392
|
-
return e.update(I);
|
393
|
-
};
|
394
|
-
})()),
|
395
|
-
e.Pipeline.registerFunction(e.stemmer, 'stemmer'),
|
396
|
-
(e.generateStopWordFilter = function (e) {
|
397
|
-
var t = e.reduce(function (e, t) {
|
398
|
-
return (e[t] = t), e;
|
399
|
-
}, {});
|
400
|
-
return function (e) {
|
401
|
-
if (e && t[e.toString()] !== e.toString()) return e;
|
402
|
-
};
|
403
|
-
}),
|
404
|
-
(e.stopWordFilter = e.generateStopWordFilter([
|
405
|
-
'a',
|
406
|
-
'able',
|
407
|
-
'about',
|
408
|
-
'across',
|
409
|
-
'after',
|
410
|
-
'all',
|
411
|
-
'almost',
|
412
|
-
'also',
|
413
|
-
'am',
|
414
|
-
'among',
|
415
|
-
'an',
|
416
|
-
'and',
|
417
|
-
'any',
|
418
|
-
'are',
|
419
|
-
'as',
|
420
|
-
'at',
|
421
|
-
'be',
|
422
|
-
'because',
|
423
|
-
'been',
|
424
|
-
'but',
|
425
|
-
'by',
|
426
|
-
'can',
|
427
|
-
'cannot',
|
428
|
-
'could',
|
429
|
-
'dear',
|
430
|
-
'did',
|
431
|
-
'do',
|
432
|
-
'does',
|
433
|
-
'either',
|
434
|
-
'else',
|
435
|
-
'ever',
|
436
|
-
'every',
|
437
|
-
'for',
|
438
|
-
'from',
|
439
|
-
'get',
|
440
|
-
'got',
|
441
|
-
'had',
|
442
|
-
'has',
|
443
|
-
'have',
|
444
|
-
'he',
|
445
|
-
'her',
|
446
|
-
'hers',
|
447
|
-
'him',
|
448
|
-
'his',
|
449
|
-
'how',
|
450
|
-
'however',
|
451
|
-
'i',
|
452
|
-
'if',
|
453
|
-
'in',
|
454
|
-
'into',
|
455
|
-
'is',
|
456
|
-
'it',
|
457
|
-
'its',
|
458
|
-
'just',
|
459
|
-
'least',
|
460
|
-
'let',
|
461
|
-
'like',
|
462
|
-
'likely',
|
463
|
-
'may',
|
464
|
-
'me',
|
465
|
-
'might',
|
466
|
-
'most',
|
467
|
-
'must',
|
468
|
-
'my',
|
469
|
-
'neither',
|
470
|
-
'no',
|
471
|
-
'nor',
|
472
|
-
'not',
|
473
|
-
'of',
|
474
|
-
'off',
|
475
|
-
'often',
|
476
|
-
'on',
|
477
|
-
'only',
|
478
|
-
'or',
|
479
|
-
'other',
|
480
|
-
'our',
|
481
|
-
'own',
|
482
|
-
'rather',
|
483
|
-
'said',
|
484
|
-
'say',
|
485
|
-
'says',
|
486
|
-
'she',
|
487
|
-
'should',
|
488
|
-
'since',
|
489
|
-
'so',
|
490
|
-
'some',
|
491
|
-
'than',
|
492
|
-
'that',
|
493
|
-
'the',
|
494
|
-
'their',
|
495
|
-
'them',
|
496
|
-
'then',
|
497
|
-
'there',
|
498
|
-
'these',
|
499
|
-
'they',
|
500
|
-
'this',
|
501
|
-
'tis',
|
502
|
-
'to',
|
503
|
-
'too',
|
504
|
-
'twas',
|
505
|
-
'us',
|
506
|
-
'wants',
|
507
|
-
'was',
|
508
|
-
'we',
|
509
|
-
'were',
|
510
|
-
'what',
|
511
|
-
'when',
|
512
|
-
'where',
|
513
|
-
'which',
|
514
|
-
'while',
|
515
|
-
'who',
|
516
|
-
'whom',
|
517
|
-
'why',
|
518
|
-
'will',
|
519
|
-
'with',
|
520
|
-
'would',
|
521
|
-
'yet',
|
522
|
-
'you',
|
523
|
-
'your'
|
524
|
-
])),
|
525
|
-
e.Pipeline.registerFunction(e.stopWordFilter, 'stopWordFilter'),
|
526
|
-
(e.trimmer = function (e) {
|
527
|
-
return e.update(function (e) {
|
528
|
-
return e.replace(/^\W+/, '').replace(/\W+$/, '');
|
529
|
-
});
|
530
|
-
}),
|
531
|
-
e.Pipeline.registerFunction(e.trimmer, 'trimmer'),
|
532
|
-
(e.TokenSet = function () {
|
533
|
-
(this['final'] = !1), (this.edges = {}), (this.id = e.TokenSet._nextId), (e.TokenSet._nextId += 1);
|
534
|
-
}),
|
535
|
-
(e.TokenSet._nextId = 1),
|
536
|
-
(e.TokenSet.fromArray = function (t) {
|
537
|
-
for (var r = new e.TokenSet.Builder(), i = 0, n = t.length; i < n; i++) r.insert(t[i]);
|
538
|
-
return r.finish(), r.root;
|
539
|
-
}),
|
540
|
-
(e.TokenSet.fromClause = function (t) {
|
541
|
-
return 'editDistance' in t ? e.TokenSet.fromFuzzyString(t.term, t.editDistance) : e.TokenSet.fromString(t.term);
|
542
|
-
}),
|
543
|
-
(e.TokenSet.fromFuzzyString = function (t, r) {
|
544
|
-
for (var i = new e.TokenSet(), n = [{ node: i, editsRemaining: r, str: t }]; n.length; ) {
|
545
|
-
var s = n.pop();
|
546
|
-
if (s.str.length > 0) {
|
547
|
-
var o,
|
548
|
-
a = s.str.charAt(0);
|
549
|
-
a in s.node.edges ? (o = s.node.edges[a]) : ((o = new e.TokenSet()), (s.node.edges[a] = o)),
|
550
|
-
1 == s.str.length && (o['final'] = !0),
|
551
|
-
n.push({ node: o, editsRemaining: s.editsRemaining, str: s.str.slice(1) });
|
552
|
-
}
|
553
|
-
if (0 != s.editsRemaining) {
|
554
|
-
if ('*' in s.node.edges) var u = s.node.edges['*'];
|
555
|
-
else {
|
556
|
-
var u = new e.TokenSet();
|
557
|
-
s.node.edges['*'] = u;
|
558
|
-
}
|
559
|
-
if (
|
560
|
-
(0 == s.str.length && (u['final'] = !0),
|
561
|
-
n.push({ node: u, editsRemaining: s.editsRemaining - 1, str: s.str }),
|
562
|
-
s.str.length > 1 && n.push({ node: s.node, editsRemaining: s.editsRemaining - 1, str: s.str.slice(1) }),
|
563
|
-
1 == s.str.length && (s.node['final'] = !0),
|
564
|
-
s.str.length >= 1)
|
565
|
-
) {
|
566
|
-
if ('*' in s.node.edges) var l = s.node.edges['*'];
|
567
|
-
else {
|
568
|
-
var l = new e.TokenSet();
|
569
|
-
s.node.edges['*'] = l;
|
570
|
-
}
|
571
|
-
1 == s.str.length && (l['final'] = !0),
|
572
|
-
n.push({ node: l, editsRemaining: s.editsRemaining - 1, str: s.str.slice(1) });
|
573
|
-
}
|
574
|
-
if (s.str.length > 1) {
|
575
|
-
var c,
|
576
|
-
h = s.str.charAt(0),
|
577
|
-
d = s.str.charAt(1);
|
578
|
-
d in s.node.edges ? (c = s.node.edges[d]) : ((c = new e.TokenSet()), (s.node.edges[d] = c)),
|
579
|
-
1 == s.str.length && (c['final'] = !0),
|
580
|
-
n.push({ node: c, editsRemaining: s.editsRemaining - 1, str: h + s.str.slice(2) });
|
581
|
-
}
|
582
|
-
}
|
583
|
-
}
|
584
|
-
return i;
|
585
|
-
}),
|
586
|
-
(e.TokenSet.fromString = function (t) {
|
587
|
-
for (var r = new e.TokenSet(), i = r, n = 0, s = t.length; n < s; n++) {
|
588
|
-
var o = t[n],
|
589
|
-
a = n == s - 1;
|
590
|
-
if ('*' == o) (r.edges[o] = r), (r['final'] = a);
|
591
|
-
else {
|
592
|
-
var u = new e.TokenSet();
|
593
|
-
(u['final'] = a), (r.edges[o] = u), (r = u);
|
594
|
-
}
|
595
|
-
}
|
596
|
-
return i;
|
597
|
-
}),
|
598
|
-
(e.TokenSet.prototype.toArray = function () {
|
599
|
-
for (var e = [], t = [{ prefix: '', node: this }]; t.length; ) {
|
600
|
-
var r = t.pop(),
|
601
|
-
i = Object.keys(r.node.edges),
|
602
|
-
n = i.length;
|
603
|
-
r.node['final'] && (r.prefix.charAt(0), e.push(r.prefix));
|
604
|
-
for (var s = 0; s < n; s++) {
|
605
|
-
var o = i[s];
|
606
|
-
t.push({ prefix: r.prefix.concat(o), node: r.node.edges[o] });
|
607
|
-
}
|
608
|
-
}
|
609
|
-
return e;
|
610
|
-
}),
|
611
|
-
(e.TokenSet.prototype.toString = function () {
|
612
|
-
if (this._str) return this._str;
|
613
|
-
for (var e = this['final'] ? '1' : '0', t = Object.keys(this.edges).sort(), r = t.length, i = 0; i < r; i++) {
|
614
|
-
var n = t[i],
|
615
|
-
s = this.edges[n];
|
616
|
-
e = e + n + s.id;
|
617
|
-
}
|
618
|
-
return e;
|
619
|
-
}),
|
620
|
-
(e.TokenSet.prototype.intersect = function (t) {
|
621
|
-
for (var r = new e.TokenSet(), i = void 0, n = [{ qNode: t, output: r, node: this }]; n.length; ) {
|
622
|
-
i = n.pop();
|
623
|
-
for (
|
624
|
-
var s = Object.keys(i.qNode.edges), o = s.length, a = Object.keys(i.node.edges), u = a.length, l = 0;
|
625
|
-
l < o;
|
626
|
-
l++
|
627
|
-
)
|
628
|
-
for (var c = s[l], h = 0; h < u; h++) {
|
629
|
-
var d = a[h];
|
630
|
-
if (d == c || '*' == c) {
|
631
|
-
var f = i.node.edges[d],
|
632
|
-
p = i.qNode.edges[c],
|
633
|
-
y = f['final'] && p['final'],
|
634
|
-
m = void 0;
|
635
|
-
d in i.output.edges
|
636
|
-
? ((m = i.output.edges[d]), (m['final'] = m['final'] || y))
|
637
|
-
: ((m = new e.TokenSet()), (m['final'] = y), (i.output.edges[d] = m)),
|
638
|
-
n.push({ qNode: p, output: m, node: f });
|
639
|
-
}
|
640
|
-
}
|
641
|
-
}
|
642
|
-
return r;
|
643
|
-
}),
|
644
|
-
(e.TokenSet.Builder = function () {
|
645
|
-
(this.previousWord = ''), (this.root = new e.TokenSet()), (this.uncheckedNodes = []), (this.minimizedNodes = {});
|
646
|
-
}),
|
647
|
-
(e.TokenSet.Builder.prototype.insert = function (t) {
|
648
|
-
var r,
|
649
|
-
i = 0;
|
650
|
-
if (t < this.previousWord) throw new Error('Out of order word insertion');
|
651
|
-
for (var n = 0; n < t.length && n < this.previousWord.length && t[n] == this.previousWord[n]; n++) i++;
|
652
|
-
this.minimize(i),
|
653
|
-
(r = 0 == this.uncheckedNodes.length ? this.root : this.uncheckedNodes[this.uncheckedNodes.length - 1].child);
|
654
|
-
for (var n = i; n < t.length; n++) {
|
655
|
-
var s = new e.TokenSet(),
|
656
|
-
o = t[n];
|
657
|
-
(r.edges[o] = s), this.uncheckedNodes.push({ parent: r, char: o, child: s }), (r = s);
|
658
|
-
}
|
659
|
-
(r['final'] = !0), (this.previousWord = t);
|
660
|
-
}),
|
661
|
-
(e.TokenSet.Builder.prototype.finish = function () {
|
662
|
-
this.minimize(0);
|
663
|
-
}),
|
664
|
-
(e.TokenSet.Builder.prototype.minimize = function (e) {
|
665
|
-
for (var t = this.uncheckedNodes.length - 1; t >= e; t--) {
|
666
|
-
var r = this.uncheckedNodes[t],
|
667
|
-
i = r.child.toString();
|
668
|
-
i in this.minimizedNodes
|
669
|
-
? (r.parent.edges[r['char']] = this.minimizedNodes[i])
|
670
|
-
: ((r.child._str = i), (this.minimizedNodes[i] = r.child)),
|
671
|
-
this.uncheckedNodes.pop();
|
672
|
-
}
|
673
|
-
}),
|
674
|
-
(e.Index = function (e) {
|
675
|
-
(this.invertedIndex = e.invertedIndex),
|
676
|
-
(this.fieldVectors = e.fieldVectors),
|
677
|
-
(this.tokenSet = e.tokenSet),
|
678
|
-
(this.fields = e.fields),
|
679
|
-
(this.pipeline = e.pipeline);
|
680
|
-
}),
|
681
|
-
(e.Index.prototype.search = function (t) {
|
682
|
-
return this.query(function (r) {
|
683
|
-
var i = new e.QueryParser(t, r);
|
684
|
-
i.parse();
|
685
|
-
});
|
686
|
-
}),
|
687
|
-
(e.Index.prototype.query = function (t) {
|
688
|
-
for (
|
689
|
-
var r = new e.Query(this.fields),
|
690
|
-
i = Object.create(null),
|
691
|
-
n = Object.create(null),
|
692
|
-
s = Object.create(null),
|
693
|
-
o = Object.create(null),
|
694
|
-
a = Object.create(null),
|
695
|
-
u = 0;
|
696
|
-
u < this.fields.length;
|
697
|
-
u++
|
698
|
-
)
|
699
|
-
n[this.fields[u]] = new e.Vector();
|
700
|
-
t.call(r, r);
|
701
|
-
for (var u = 0; u < r.clauses.length; u++) {
|
702
|
-
var l = r.clauses[u],
|
703
|
-
c = null,
|
704
|
-
h = e.Set.empty;
|
705
|
-
c = l.usePipeline ? this.pipeline.runString(l.term, { fields: l.fields }) : [l.term];
|
706
|
-
for (var d = 0; d < c.length; d++) {
|
707
|
-
var f = c[d];
|
708
|
-
l.term = f;
|
709
|
-
var p = e.TokenSet.fromClause(l),
|
710
|
-
y = this.tokenSet.intersect(p).toArray();
|
711
|
-
if (0 === y.length && l.presence === e.Query.presence.REQUIRED) {
|
712
|
-
for (var m = 0; m < l.fields.length; m++) {
|
713
|
-
var v = l.fields[m];
|
714
|
-
o[v] = e.Set.empty;
|
715
|
-
}
|
716
|
-
break;
|
717
|
-
}
|
718
|
-
for (var g = 0; g < y.length; g++)
|
719
|
-
for (var x = y[g], w = this.invertedIndex[x], Q = w._index, m = 0; m < l.fields.length; m++) {
|
720
|
-
var v = l.fields[m],
|
721
|
-
k = w[v],
|
722
|
-
S = Object.keys(k),
|
723
|
-
E = x + '/' + v,
|
724
|
-
L = new e.Set(S);
|
725
|
-
if (
|
726
|
-
(l.presence == e.Query.presence.REQUIRED &&
|
727
|
-
((h = h.union(L)), void 0 === o[v] && (o[v] = e.Set.complete)),
|
728
|
-
l.presence != e.Query.presence.PROHIBITED)
|
729
|
-
) {
|
730
|
-
if (
|
731
|
-
(n[v].upsert(Q, l.boost, function (e, t) {
|
732
|
-
return e + t;
|
733
|
-
}),
|
734
|
-
!s[E])
|
735
|
-
) {
|
736
|
-
for (var b = 0; b < S.length; b++) {
|
737
|
-
var P,
|
738
|
-
T = S[b],
|
739
|
-
O = new e.FieldRef(T, v),
|
740
|
-
I = k[T];
|
741
|
-
void 0 === (P = i[O]) ? (i[O] = new e.MatchData(x, v, I)) : P.add(x, v, I);
|
742
|
-
}
|
743
|
-
s[E] = !0;
|
744
|
-
}
|
745
|
-
} else void 0 === a[v] && (a[v] = e.Set.empty), (a[v] = a[v].union(L));
|
746
|
-
}
|
747
|
-
}
|
748
|
-
if (l.presence === e.Query.presence.REQUIRED)
|
749
|
-
for (var m = 0; m < l.fields.length; m++) {
|
750
|
-
var v = l.fields[m];
|
751
|
-
o[v] = o[v].intersect(h);
|
752
|
-
}
|
753
|
-
}
|
754
|
-
for (var R = e.Set.complete, F = e.Set.empty, u = 0; u < this.fields.length; u++) {
|
755
|
-
var v = this.fields[u];
|
756
|
-
o[v] && (R = R.intersect(o[v])), a[v] && (F = F.union(a[v]));
|
757
|
-
}
|
758
|
-
var C = Object.keys(i),
|
759
|
-
N = [],
|
760
|
-
_ = Object.create(null);
|
761
|
-
if (r.isNegated()) {
|
762
|
-
C = Object.keys(this.fieldVectors);
|
763
|
-
for (var u = 0; u < C.length; u++) {
|
764
|
-
var O = C[u],
|
765
|
-
j = e.FieldRef.fromString(O);
|
766
|
-
i[O] = new e.MatchData();
|
767
|
-
}
|
768
|
-
}
|
769
|
-
for (var u = 0; u < C.length; u++) {
|
770
|
-
var j = e.FieldRef.fromString(C[u]),
|
771
|
-
D = j.docRef;
|
772
|
-
if (R.contains(D) && !F.contains(D)) {
|
773
|
-
var A,
|
774
|
-
B = this.fieldVectors[j],
|
775
|
-
V = n[j.fieldName].similarity(B);
|
776
|
-
if (void 0 !== (A = _[D])) (A.score += V), A.matchData.combine(i[j]);
|
777
|
-
else {
|
778
|
-
var z = { ref: D, score: V, matchData: i[j] };
|
779
|
-
(_[D] = z), N.push(z);
|
780
|
-
}
|
781
|
-
}
|
782
|
-
}
|
783
|
-
return N.sort(function (e, t) {
|
784
|
-
return t.score - e.score;
|
785
|
-
});
|
786
|
-
}),
|
787
|
-
(e.Index.prototype.toJSON = function () {
|
788
|
-
var t = Object.keys(this.invertedIndex)
|
789
|
-
.sort()
|
790
|
-
.map(function (e) {
|
791
|
-
return [e, this.invertedIndex[e]];
|
792
|
-
}, this),
|
793
|
-
r = Object.keys(this.fieldVectors).map(function (e) {
|
794
|
-
return [e, this.fieldVectors[e].toJSON()];
|
795
|
-
}, this);
|
796
|
-
return {
|
797
|
-
version: e.version,
|
798
|
-
fields: this.fields,
|
799
|
-
fieldVectors: r,
|
800
|
-
invertedIndex: t,
|
801
|
-
pipeline: this.pipeline.toJSON()
|
802
|
-
};
|
803
|
-
}),
|
804
|
-
(e.Index.load = function (t) {
|
805
|
-
var r = {},
|
806
|
-
i = {},
|
807
|
-
n = t.fieldVectors,
|
808
|
-
s = Object.create(null),
|
809
|
-
o = t.invertedIndex,
|
810
|
-
a = new e.TokenSet.Builder(),
|
811
|
-
u = e.Pipeline.load(t.pipeline);
|
812
|
-
t.version != e.version &&
|
813
|
-
e.utils.warn(
|
814
|
-
"Version mismatch when loading serialised index. Current version of lunr '" +
|
815
|
-
e.version +
|
816
|
-
"' does not match serialized index '" +
|
817
|
-
t.version +
|
818
|
-
"'"
|
819
|
-
);
|
820
|
-
for (var l = 0; l < n.length; l++) {
|
821
|
-
var c = n[l],
|
822
|
-
h = c[0],
|
823
|
-
d = c[1];
|
824
|
-
i[h] = new e.Vector(d);
|
825
|
-
}
|
826
|
-
for (var l = 0; l < o.length; l++) {
|
827
|
-
var c = o[l],
|
828
|
-
f = c[0],
|
829
|
-
p = c[1];
|
830
|
-
a.insert(f), (s[f] = p);
|
831
|
-
}
|
832
|
-
return (
|
833
|
-
a.finish(),
|
834
|
-
(r.fields = t.fields),
|
835
|
-
(r.fieldVectors = i),
|
836
|
-
(r.invertedIndex = s),
|
837
|
-
(r.tokenSet = a.root),
|
838
|
-
(r.pipeline = u),
|
839
|
-
new e.Index(r)
|
840
|
-
);
|
841
|
-
}),
|
842
|
-
(e.Builder = function () {
|
843
|
-
(this._ref = 'id'),
|
844
|
-
(this._fields = Object.create(null)),
|
845
|
-
(this._documents = Object.create(null)),
|
846
|
-
(this.invertedIndex = Object.create(null)),
|
847
|
-
(this.fieldTermFrequencies = {}),
|
848
|
-
(this.fieldLengths = {}),
|
849
|
-
(this.tokenizer = e.tokenizer),
|
850
|
-
(this.pipeline = new e.Pipeline()),
|
851
|
-
(this.searchPipeline = new e.Pipeline()),
|
852
|
-
(this.documentCount = 0),
|
853
|
-
(this._b = 0.75),
|
854
|
-
(this._k1 = 1.2),
|
855
|
-
(this.termIndex = 0),
|
856
|
-
(this.metadataWhitelist = []);
|
857
|
-
}),
|
858
|
-
(e.Builder.prototype.ref = function (e) {
|
859
|
-
this._ref = e;
|
860
|
-
}),
|
861
|
-
(e.Builder.prototype.field = function (e, t) {
|
862
|
-
if (/\//.test(e)) throw new RangeError("Field '" + e + "' contains illegal character '/'");
|
863
|
-
this._fields[e] = t || {};
|
864
|
-
}),
|
865
|
-
(e.Builder.prototype.b = function (e) {
|
866
|
-
e < 0 ? (this._b = 0) : e > 1 ? (this._b = 1) : (this._b = e);
|
867
|
-
}),
|
868
|
-
(e.Builder.prototype.k1 = function (e) {
|
869
|
-
this._k1 = e;
|
870
|
-
}),
|
871
|
-
(e.Builder.prototype.add = function (t, r) {
|
872
|
-
var i = t[this._ref],
|
873
|
-
n = Object.keys(this._fields);
|
874
|
-
(this._documents[i] = r || {}), (this.documentCount += 1);
|
875
|
-
for (var s = 0; s < n.length; s++) {
|
876
|
-
var o = n[s],
|
877
|
-
a = this._fields[o].extractor,
|
878
|
-
u = a ? a(t) : t[o],
|
879
|
-
l = this.tokenizer(u, { fields: [o] }),
|
880
|
-
c = this.pipeline.run(l),
|
881
|
-
h = new e.FieldRef(i, o),
|
882
|
-
d = Object.create(null);
|
883
|
-
(this.fieldTermFrequencies[h] = d), (this.fieldLengths[h] = 0), (this.fieldLengths[h] += c.length);
|
884
|
-
for (var f = 0; f < c.length; f++) {
|
885
|
-
var p = c[f];
|
886
|
-
if ((void 0 == d[p] && (d[p] = 0), (d[p] += 1), void 0 == this.invertedIndex[p])) {
|
887
|
-
var y = Object.create(null);
|
888
|
-
(y._index = this.termIndex), (this.termIndex += 1);
|
889
|
-
for (var m = 0; m < n.length; m++) y[n[m]] = Object.create(null);
|
890
|
-
this.invertedIndex[p] = y;
|
891
|
-
}
|
892
|
-
void 0 == this.invertedIndex[p][o][i] && (this.invertedIndex[p][o][i] = Object.create(null));
|
893
|
-
for (var v = 0; v < this.metadataWhitelist.length; v++) {
|
894
|
-
var g = this.metadataWhitelist[v],
|
895
|
-
x = p.metadata[g];
|
896
|
-
void 0 == this.invertedIndex[p][o][i][g] && (this.invertedIndex[p][o][i][g] = []),
|
897
|
-
this.invertedIndex[p][o][i][g].push(x);
|
898
|
-
}
|
899
|
-
}
|
900
|
-
}
|
901
|
-
}),
|
902
|
-
(e.Builder.prototype.calculateAverageFieldLengths = function () {
|
903
|
-
for (var t = Object.keys(this.fieldLengths), r = t.length, i = {}, n = {}, s = 0; s < r; s++) {
|
904
|
-
var o = e.FieldRef.fromString(t[s]),
|
905
|
-
a = o.fieldName;
|
906
|
-
n[a] || (n[a] = 0), (n[a] += 1), i[a] || (i[a] = 0), (i[a] += this.fieldLengths[o]);
|
907
|
-
}
|
908
|
-
for (var u = Object.keys(this._fields), s = 0; s < u.length; s++) {
|
909
|
-
var l = u[s];
|
910
|
-
i[l] = i[l] / n[l];
|
911
|
-
}
|
912
|
-
this.averageFieldLength = i;
|
913
|
-
}),
|
914
|
-
(e.Builder.prototype.createFieldVectors = function () {
|
915
|
-
for (
|
916
|
-
var t = {}, r = Object.keys(this.fieldTermFrequencies), i = r.length, n = Object.create(null), s = 0;
|
917
|
-
s < i;
|
918
|
-
s++
|
919
|
-
) {
|
920
|
-
for (
|
921
|
-
var o = e.FieldRef.fromString(r[s]),
|
922
|
-
a = o.fieldName,
|
923
|
-
u = this.fieldLengths[o],
|
924
|
-
l = new e.Vector(),
|
925
|
-
c = this.fieldTermFrequencies[o],
|
926
|
-
h = Object.keys(c),
|
927
|
-
d = h.length,
|
928
|
-
f = this._fields[a].boost || 1,
|
929
|
-
p = this._documents[o.docRef].boost || 1,
|
930
|
-
y = 0;
|
931
|
-
y < d;
|
932
|
-
y++
|
933
|
-
) {
|
934
|
-
var m,
|
935
|
-
v,
|
936
|
-
g,
|
937
|
-
x = h[y],
|
938
|
-
w = c[x],
|
939
|
-
Q = this.invertedIndex[x]._index;
|
940
|
-
void 0 === n[x] ? ((m = e.idf(this.invertedIndex[x], this.documentCount)), (n[x] = m)) : (m = n[x]),
|
941
|
-
(v =
|
942
|
-
(m * ((this._k1 + 1) * w)) / (this._k1 * (1 - this._b + this._b * (u / this.averageFieldLength[a])) + w)),
|
943
|
-
(v *= f),
|
944
|
-
(v *= p),
|
945
|
-
(g = Math.round(1e3 * v) / 1e3),
|
946
|
-
l.insert(Q, g);
|
947
|
-
}
|
948
|
-
t[o] = l;
|
949
|
-
}
|
950
|
-
this.fieldVectors = t;
|
951
|
-
}),
|
952
|
-
(e.Builder.prototype.createTokenSet = function () {
|
953
|
-
this.tokenSet = e.TokenSet.fromArray(Object.keys(this.invertedIndex).sort());
|
954
|
-
}),
|
955
|
-
(e.Builder.prototype.build = function () {
|
956
|
-
return (
|
957
|
-
this.calculateAverageFieldLengths(),
|
958
|
-
this.createFieldVectors(),
|
959
|
-
this.createTokenSet(),
|
960
|
-
new e.Index({
|
961
|
-
invertedIndex: this.invertedIndex,
|
962
|
-
fieldVectors: this.fieldVectors,
|
963
|
-
tokenSet: this.tokenSet,
|
964
|
-
fields: Object.keys(this._fields),
|
965
|
-
pipeline: this.searchPipeline
|
966
|
-
})
|
967
|
-
);
|
968
|
-
}),
|
969
|
-
(e.Builder.prototype.use = function (e) {
|
970
|
-
var t = Array.prototype.slice.call(arguments, 1);
|
971
|
-
t.unshift(this), e.apply(this, t);
|
972
|
-
}),
|
973
|
-
(e.MatchData = function (e, t, r) {
|
974
|
-
for (var i = Object.create(null), n = Object.keys(r || {}), s = 0; s < n.length; s++) {
|
975
|
-
var o = n[s];
|
976
|
-
i[o] = r[o].slice();
|
977
|
-
}
|
978
|
-
(this.metadata = Object.create(null)),
|
979
|
-
void 0 !== e && ((this.metadata[e] = Object.create(null)), (this.metadata[e][t] = i));
|
980
|
-
}),
|
981
|
-
(e.MatchData.prototype.combine = function (e) {
|
982
|
-
for (var t = Object.keys(e.metadata), r = 0; r < t.length; r++) {
|
983
|
-
var i = t[r],
|
984
|
-
n = Object.keys(e.metadata[i]);
|
985
|
-
void 0 == this.metadata[i] && (this.metadata[i] = Object.create(null));
|
986
|
-
for (var s = 0; s < n.length; s++) {
|
987
|
-
var o = n[s],
|
988
|
-
a = Object.keys(e.metadata[i][o]);
|
989
|
-
void 0 == this.metadata[i][o] && (this.metadata[i][o] = Object.create(null));
|
990
|
-
for (var u = 0; u < a.length; u++) {
|
991
|
-
var l = a[u];
|
992
|
-
void 0 == this.metadata[i][o][l]
|
993
|
-
? (this.metadata[i][o][l] = e.metadata[i][o][l])
|
994
|
-
: (this.metadata[i][o][l] = this.metadata[i][o][l].concat(e.metadata[i][o][l]));
|
995
|
-
}
|
996
|
-
}
|
997
|
-
}
|
998
|
-
}),
|
999
|
-
(e.MatchData.prototype.add = function (e, t, r) {
|
1000
|
-
if (!(e in this.metadata)) return (this.metadata[e] = Object.create(null)), void (this.metadata[e][t] = r);
|
1001
|
-
if (!(t in this.metadata[e])) return void (this.metadata[e][t] = r);
|
1002
|
-
for (var i = Object.keys(r), n = 0; n < i.length; n++) {
|
1003
|
-
var s = i[n];
|
1004
|
-
s in this.metadata[e][t]
|
1005
|
-
? (this.metadata[e][t][s] = this.metadata[e][t][s].concat(r[s]))
|
1006
|
-
: (this.metadata[e][t][s] = r[s]);
|
1007
|
-
}
|
1008
|
-
}),
|
1009
|
-
(e.Query = function (e) {
|
1010
|
-
(this.clauses = []), (this.allFields = e);
|
1011
|
-
}),
|
1012
|
-
(e.Query.wildcard = new String('*')),
|
1013
|
-
(e.Query.wildcard.NONE = 0),
|
1014
|
-
(e.Query.wildcard.LEADING = 1),
|
1015
|
-
(e.Query.wildcard.TRAILING = 2),
|
1016
|
-
(e.Query.presence = { OPTIONAL: 1, REQUIRED: 2, PROHIBITED: 3 }),
|
1017
|
-
(e.Query.prototype.clause = function (t) {
|
1018
|
-
return (
|
1019
|
-
'fields' in t || (t.fields = this.allFields),
|
1020
|
-
'boost' in t || (t.boost = 1),
|
1021
|
-
'usePipeline' in t || (t.usePipeline = !0),
|
1022
|
-
'wildcard' in t || (t.wildcard = e.Query.wildcard.NONE),
|
1023
|
-
t.wildcard & e.Query.wildcard.LEADING && t.term.charAt(0) != e.Query.wildcard && (t.term = '*' + t.term),
|
1024
|
-
t.wildcard & e.Query.wildcard.TRAILING && t.term.slice(-1) != e.Query.wildcard && (t.term = '' + t.term + '*'),
|
1025
|
-
'presence' in t || (t.presence = e.Query.presence.OPTIONAL),
|
1026
|
-
this.clauses.push(t),
|
1027
|
-
this
|
1028
|
-
);
|
1029
|
-
}),
|
1030
|
-
(e.Query.prototype.isNegated = function () {
|
1031
|
-
for (var t = 0; t < this.clauses.length; t++)
|
1032
|
-
if (this.clauses[t].presence != e.Query.presence.PROHIBITED) return !1;
|
1033
|
-
return !0;
|
1034
|
-
}),
|
1035
|
-
(e.Query.prototype.term = function (t, r) {
|
1036
|
-
if (Array.isArray(t))
|
1037
|
-
return (
|
1038
|
-
t.forEach(function (t) {
|
1039
|
-
this.term(t, e.utils.clone(r));
|
1040
|
-
}, this),
|
1041
|
-
this
|
1042
|
-
);
|
1043
|
-
var i = r || {};
|
1044
|
-
return (i.term = t.toString()), this.clause(i), this;
|
1045
|
-
}),
|
1046
|
-
(e.QueryParseError = function (e, t, r) {
|
1047
|
-
(this.name = 'QueryParseError'), (this.message = e), (this.start = t), (this.end = r);
|
1048
|
-
}),
|
1049
|
-
(e.QueryParseError.prototype = new Error()),
|
1050
|
-
(e.QueryLexer = function (e) {
|
1051
|
-
(this.lexemes = []),
|
1052
|
-
(this.str = e),
|
1053
|
-
(this.length = e.length),
|
1054
|
-
(this.pos = 0),
|
1055
|
-
(this.start = 0),
|
1056
|
-
(this.escapeCharPositions = []);
|
1057
|
-
}),
|
1058
|
-
(e.QueryLexer.prototype.run = function () {
|
1059
|
-
for (var t = e.QueryLexer.lexText; t; ) t = t(this);
|
1060
|
-
}),
|
1061
|
-
(e.QueryLexer.prototype.sliceString = function () {
|
1062
|
-
for (var e = [], t = this.start, r = this.pos, i = 0; i < this.escapeCharPositions.length; i++)
|
1063
|
-
(r = this.escapeCharPositions[i]), e.push(this.str.slice(t, r)), (t = r + 1);
|
1064
|
-
return e.push(this.str.slice(t, this.pos)), (this.escapeCharPositions.length = 0), e.join('');
|
1065
|
-
}),
|
1066
|
-
(e.QueryLexer.prototype.emit = function (e) {
|
1067
|
-
this.lexemes.push({ type: e, str: this.sliceString(), start: this.start, end: this.pos }),
|
1068
|
-
(this.start = this.pos);
|
1069
|
-
}),
|
1070
|
-
(e.QueryLexer.prototype.escapeCharacter = function () {
|
1071
|
-
this.escapeCharPositions.push(this.pos - 1), (this.pos += 1);
|
1072
|
-
}),
|
1073
|
-
(e.QueryLexer.prototype.next = function () {
|
1074
|
-
if (this.pos >= this.length) return e.QueryLexer.EOS;
|
1075
|
-
var t = this.str.charAt(this.pos);
|
1076
|
-
return (this.pos += 1), t;
|
1077
|
-
}),
|
1078
|
-
(e.QueryLexer.prototype.width = function () {
|
1079
|
-
return this.pos - this.start;
|
1080
|
-
}),
|
1081
|
-
(e.QueryLexer.prototype.ignore = function () {
|
1082
|
-
this.start == this.pos && (this.pos += 1), (this.start = this.pos);
|
1083
|
-
}),
|
1084
|
-
(e.QueryLexer.prototype.backup = function () {
|
1085
|
-
this.pos -= 1;
|
1086
|
-
}),
|
1087
|
-
(e.QueryLexer.prototype.acceptDigitRun = function () {
|
1088
|
-
var t, r;
|
1089
|
-
do (t = this.next()), (r = t.charCodeAt(0));
|
1090
|
-
while (r > 47 && r < 58);
|
1091
|
-
t != e.QueryLexer.EOS && this.backup();
|
1092
|
-
}),
|
1093
|
-
(e.QueryLexer.prototype.more = function () {
|
1094
|
-
return this.pos < this.length;
|
1095
|
-
}),
|
1096
|
-
(e.QueryLexer.EOS = 'EOS'),
|
1097
|
-
(e.QueryLexer.FIELD = 'FIELD'),
|
1098
|
-
(e.QueryLexer.TERM = 'TERM'),
|
1099
|
-
(e.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE'),
|
1100
|
-
(e.QueryLexer.BOOST = 'BOOST'),
|
1101
|
-
(e.QueryLexer.PRESENCE = 'PRESENCE'),
|
1102
|
-
(e.QueryLexer.lexField = function (t) {
|
1103
|
-
return t.backup(), t.emit(e.QueryLexer.FIELD), t.ignore(), e.QueryLexer.lexText;
|
1104
|
-
}),
|
1105
|
-
(e.QueryLexer.lexTerm = function (t) {
|
1106
|
-
if ((t.width() > 1 && (t.backup(), t.emit(e.QueryLexer.TERM)), t.ignore(), t.more())) return e.QueryLexer.lexText;
|
1107
|
-
}),
|
1108
|
-
(e.QueryLexer.lexEditDistance = function (t) {
|
1109
|
-
return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.EDIT_DISTANCE), e.QueryLexer.lexText;
|
1110
|
-
}),
|
1111
|
-
(e.QueryLexer.lexBoost = function (t) {
|
1112
|
-
return t.ignore(), t.acceptDigitRun(), t.emit(e.QueryLexer.BOOST), e.QueryLexer.lexText;
|
1113
|
-
}),
|
1114
|
-
(e.QueryLexer.lexEOS = function (t) {
|
1115
|
-
t.width() > 0 && t.emit(e.QueryLexer.TERM);
|
1116
|
-
}),
|
1117
|
-
(e.QueryLexer.termSeparator = e.tokenizer.separator),
|
1118
|
-
(e.QueryLexer.lexText = function (t) {
|
1119
|
-
for (;;) {
|
1120
|
-
var r = t.next();
|
1121
|
-
if (r == e.QueryLexer.EOS) return e.QueryLexer.lexEOS;
|
1122
|
-
if (92 != r.charCodeAt(0)) {
|
1123
|
-
if (':' == r) return e.QueryLexer.lexField;
|
1124
|
-
if ('~' == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexEditDistance;
|
1125
|
-
if ('^' == r) return t.backup(), t.width() > 0 && t.emit(e.QueryLexer.TERM), e.QueryLexer.lexBoost;
|
1126
|
-
if ('+' == r && 1 === t.width()) return t.emit(e.QueryLexer.PRESENCE), e.QueryLexer.lexText;
|
1127
|
-
if ('-' == r && 1 === t.width()) return t.emit(e.QueryLexer.PRESENCE), e.QueryLexer.lexText;
|
1128
|
-
if (r.match(e.QueryLexer.termSeparator)) return e.QueryLexer.lexTerm;
|
1129
|
-
} else t.escapeCharacter();
|
1130
|
-
}
|
1131
|
-
}),
|
1132
|
-
(e.QueryParser = function (t, r) {
|
1133
|
-
(this.lexer = new e.QueryLexer(t)), (this.query = r), (this.currentClause = {}), (this.lexemeIdx = 0);
|
1134
|
-
}),
|
1135
|
-
(e.QueryParser.prototype.parse = function () {
|
1136
|
-
this.lexer.run(), (this.lexemes = this.lexer.lexemes);
|
1137
|
-
for (var t = e.QueryParser.parseClause; t; ) t = t(this);
|
1138
|
-
return this.query;
|
1139
|
-
}),
|
1140
|
-
(e.QueryParser.prototype.peekLexeme = function () {
|
1141
|
-
return this.lexemes[this.lexemeIdx];
|
1142
|
-
}),
|
1143
|
-
(e.QueryParser.prototype.consumeLexeme = function () {
|
1144
|
-
var e = this.peekLexeme();
|
1145
|
-
return (this.lexemeIdx += 1), e;
|
1146
|
-
}),
|
1147
|
-
(e.QueryParser.prototype.nextClause = function () {
|
1148
|
-
var e = this.currentClause;
|
1149
|
-
this.query.clause(e), (this.currentClause = {});
|
1150
|
-
}),
|
1151
|
-
(e.QueryParser.parseClause = function (t) {
|
1152
|
-
var r = t.peekLexeme();
|
1153
|
-
if (void 0 != r)
|
1154
|
-
switch (r.type) {
|
1155
|
-
case e.QueryLexer.PRESENCE:
|
1156
|
-
return e.QueryParser.parsePresence;
|
1157
|
-
case e.QueryLexer.FIELD:
|
1158
|
-
return e.QueryParser.parseField;
|
1159
|
-
case e.QueryLexer.TERM:
|
1160
|
-
return e.QueryParser.parseTerm;
|
1161
|
-
default:
|
1162
|
-
var i = 'expected either a field or a term, found ' + r.type;
|
1163
|
-
throw (r.str.length >= 1 && (i += " with value '" + r.str + "'"), new e.QueryParseError(i, r.start, r.end));
|
1164
|
-
}
|
1165
|
-
}),
|
1166
|
-
(e.QueryParser.parsePresence = function (t) {
|
1167
|
-
var r = t.consumeLexeme();
|
1168
|
-
if (void 0 != r) {
|
1169
|
-
switch (r.str) {
|
1170
|
-
case '-':
|
1171
|
-
t.currentClause.presence = e.Query.presence.PROHIBITED;
|
1172
|
-
break;
|
1173
|
-
case '+':
|
1174
|
-
t.currentClause.presence = e.Query.presence.REQUIRED;
|
1175
|
-
break;
|
1176
|
-
default:
|
1177
|
-
var i = "unrecognised presence operator'" + r.str + "'";
|
1178
|
-
throw new e.QueryParseError(i, r.start, r.end);
|
1179
|
-
}
|
1180
|
-
var n = t.peekLexeme();
|
1181
|
-
if (void 0 == n) {
|
1182
|
-
var i = 'expecting term or field, found nothing';
|
1183
|
-
throw new e.QueryParseError(i, r.start, r.end);
|
1184
|
-
}
|
1185
|
-
switch (n.type) {
|
1186
|
-
case e.QueryLexer.FIELD:
|
1187
|
-
return e.QueryParser.parseField;
|
1188
|
-
case e.QueryLexer.TERM:
|
1189
|
-
return e.QueryParser.parseTerm;
|
1190
|
-
default:
|
1191
|
-
var i = "expecting term or field, found '" + n.type + "'";
|
1192
|
-
throw new e.QueryParseError(i, n.start, n.end);
|
1193
|
-
}
|
1194
|
-
}
|
1195
|
-
}),
|
1196
|
-
(e.QueryParser.parseField = function (t) {
|
1197
|
-
var r = t.consumeLexeme();
|
1198
|
-
if (void 0 != r) {
|
1199
|
-
if (t.query.allFields.indexOf(r.str) == -1) {
|
1200
|
-
var i = t.query.allFields
|
1201
|
-
.map(function (e) {
|
1202
|
-
return "'" + e + "'";
|
1203
|
-
})
|
1204
|
-
.join(', '),
|
1205
|
-
n = "unrecognised field '" + r.str + "', possible fields: " + i;
|
1206
|
-
throw new e.QueryParseError(n, r.start, r.end);
|
1207
|
-
}
|
1208
|
-
t.currentClause.fields = [r.str];
|
1209
|
-
var s = t.peekLexeme();
|
1210
|
-
if (void 0 == s) {
|
1211
|
-
var n = 'expecting term, found nothing';
|
1212
|
-
throw new e.QueryParseError(n, r.start, r.end);
|
1213
|
-
}
|
1214
|
-
switch (s.type) {
|
1215
|
-
case e.QueryLexer.TERM:
|
1216
|
-
return e.QueryParser.parseTerm;
|
1217
|
-
default:
|
1218
|
-
var n = "expecting term, found '" + s.type + "'";
|
1219
|
-
throw new e.QueryParseError(n, s.start, s.end);
|
1220
|
-
}
|
1221
|
-
}
|
1222
|
-
}),
|
1223
|
-
(e.QueryParser.parseTerm = function (t) {
|
1224
|
-
var r = t.consumeLexeme();
|
1225
|
-
if (void 0 != r) {
|
1226
|
-
(t.currentClause.term = r.str.toLowerCase()), r.str.indexOf('*') != -1 && (t.currentClause.usePipeline = !1);
|
1227
|
-
var i = t.peekLexeme();
|
1228
|
-
if (void 0 == i) return void t.nextClause();
|
1229
|
-
switch (i.type) {
|
1230
|
-
case e.QueryLexer.TERM:
|
1231
|
-
return t.nextClause(), e.QueryParser.parseTerm;
|
1232
|
-
case e.QueryLexer.FIELD:
|
1233
|
-
return t.nextClause(), e.QueryParser.parseField;
|
1234
|
-
case e.QueryLexer.EDIT_DISTANCE:
|
1235
|
-
return e.QueryParser.parseEditDistance;
|
1236
|
-
case e.QueryLexer.BOOST:
|
1237
|
-
return e.QueryParser.parseBoost;
|
1238
|
-
case e.QueryLexer.PRESENCE:
|
1239
|
-
return t.nextClause(), e.QueryParser.parsePresence;
|
1240
|
-
default:
|
1241
|
-
var n = "Unexpected lexeme type '" + i.type + "'";
|
1242
|
-
throw new e.QueryParseError(n, i.start, i.end);
|
1243
|
-
}
|
1244
|
-
}
|
1245
|
-
}),
|
1246
|
-
(e.QueryParser.parseEditDistance = function (t) {
|
1247
|
-
var r = t.consumeLexeme();
|
1248
|
-
if (void 0 != r) {
|
1249
|
-
var i = parseInt(r.str, 10);
|
1250
|
-
if (isNaN(i)) {
|
1251
|
-
var n = 'edit distance must be numeric';
|
1252
|
-
throw new e.QueryParseError(n, r.start, r.end);
|
1253
|
-
}
|
1254
|
-
t.currentClause.editDistance = i;
|
1255
|
-
var s = t.peekLexeme();
|
1256
|
-
if (void 0 == s) return void t.nextClause();
|
1257
|
-
switch (s.type) {
|
1258
|
-
case e.QueryLexer.TERM:
|
1259
|
-
return t.nextClause(), e.QueryParser.parseTerm;
|
1260
|
-
case e.QueryLexer.FIELD:
|
1261
|
-
return t.nextClause(), e.QueryParser.parseField;
|
1262
|
-
case e.QueryLexer.EDIT_DISTANCE:
|
1263
|
-
return e.QueryParser.parseEditDistance;
|
1264
|
-
case e.QueryLexer.BOOST:
|
1265
|
-
return e.QueryParser.parseBoost;
|
1266
|
-
case e.QueryLexer.PRESENCE:
|
1267
|
-
return t.nextClause(), e.QueryParser.parsePresence;
|
1268
|
-
default:
|
1269
|
-
var n = "Unexpected lexeme type '" + s.type + "'";
|
1270
|
-
throw new e.QueryParseError(n, s.start, s.end);
|
1271
|
-
}
|
1272
|
-
}
|
1273
|
-
}),
|
1274
|
-
(e.QueryParser.parseBoost = function (t) {
|
1275
|
-
var r = t.consumeLexeme();
|
1276
|
-
if (void 0 != r) {
|
1277
|
-
var i = parseInt(r.str, 10);
|
1278
|
-
if (isNaN(i)) {
|
1279
|
-
var n = 'boost must be numeric';
|
1280
|
-
throw new e.QueryParseError(n, r.start, r.end);
|
1281
|
-
}
|
1282
|
-
t.currentClause.boost = i;
|
1283
|
-
var s = t.peekLexeme();
|
1284
|
-
if (void 0 == s) return void t.nextClause();
|
1285
|
-
switch (s.type) {
|
1286
|
-
case e.QueryLexer.TERM:
|
1287
|
-
return t.nextClause(), e.QueryParser.parseTerm;
|
1288
|
-
case e.QueryLexer.FIELD:
|
1289
|
-
return t.nextClause(), e.QueryParser.parseField;
|
1290
|
-
case e.QueryLexer.EDIT_DISTANCE:
|
1291
|
-
return e.QueryParser.parseEditDistance;
|
1292
|
-
case e.QueryLexer.BOOST:
|
1293
|
-
return e.QueryParser.parseBoost;
|
1294
|
-
case e.QueryLexer.PRESENCE:
|
1295
|
-
return t.nextClause(), e.QueryParser.parsePresence;
|
1296
|
-
default:
|
1297
|
-
var n = "Unexpected lexeme type '" + s.type + "'";
|
1298
|
-
throw new e.QueryParseError(n, s.start, s.end);
|
1299
|
-
}
|
1300
|
-
}
|
1301
|
-
}),
|
1302
|
-
(function (e, t) {
|
1303
|
-
'function' == typeof define && define.amd
|
1304
|
-
? define(t)
|
1305
|
-
: 'object' == typeof exports
|
1306
|
-
? (module.exports = t())
|
1307
|
-
: (e.lunr = t());
|
1308
|
-
})(this, function () {
|
1309
|
-
return e;
|
1310
|
-
});
|
1311
|
-
})();
|